Skip to content
DeepForgeby svx
All problems
MediumTime Seriests-080

ARCH-lite Test Statistic

Problem

Compute the ARCH Lagrange multiplier statistic from a residual series: LM = n * sum over k = 1..h of rho(k)^2, where rho(k) is the biased sample autocorrelation of the squared residuals.

Return 0.0 for an empty series, h <= 0, or squared residuals with zero variance.

Hint

Under the null of no ARCH effects the statistic is approximately chi-squared with h degrees of freedom.

Test cases

case 1
in: [[1,-1,1,-1],1]
expected: 0
case 2
in: [[1,2,1,2,1,2],1]
expected: 4.166666666666667
case 3
in: [[1,2,3],2]
expected: 0.710294321810357
case 4
in: [[0,0,0],1]
expected: 0
Starter codePython
def arch_lm_statistic(residuals, h):
    # Your code here
    pass

4 test cases · run your code against them in the editor