Skip to content

DPredict · Guide test 193

Engle ARCH LM test

Tests whether squared residuals are predictable from their lags, indicating conditional heteroskedasticity.

Runs in CodeSplashPython example validatedR example validated

Do it in CodeSplash

In the app, set it up in Analyze with this method:

In Linear regression (OLS), choose Residual diagnostics = Full battery.

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · Engle ARCH LM test

120
0.50

0: constant variance. Larger α: calm and turbulent spells.

2
0.050

Your data

Simulated with known truth

ARCH effects show as clusters in the squared series: big moves follow big moves.

If H₀ were true

LM = 17.34
  1. The reference: how LM varies across samples when H₀ is true (χ² approximation).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = < .001).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

et2=α0+∑j=1qαjet−j2+vt,LM=(n−q) R2∼χq2e_t^2 = \alpha_0 + \sum_{j=1}^{q}\alpha_j e_{t-j}^2 + v_t,\qquad LM = (n-q)\,R^2 \sim \chi^2_q

With your numbers

LM=17.34,q=2, n=120LM = 17.34,\qquad q = 2,\ n = 120
ete_t
demeaned returns (or regression residuals)
R2R^2
of the squared residuals on their own lags

The verdict

LM(2) = 17.34, p < .001

p ≤ α = .050: reject H₀

Unmodelled autocorrelation in the mean also makes squares autocorrelated; fit the mean first.

Statistic
17.337
p-value
0.0002
Engle ARCH LM test on 120 returns: LM(2) = 17.34, p < .001. The p-value is below α = .050, so the data are hard to reconcile with H0.

Engle ARCH LM test on 120 returns: LM(2) = 17.34, p < .001. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: no ARCH effects through lag q.

Assumptions

Correct conditional mean; innovations and moment conditions sufficient for the LM limit; ordered observations and prespecified q.

Formula

et2=α0+∑j=1qαjet−j2+vtLM=neffR2\begin{gathered}e_t^2=\alpha_0+\sum_{j=1}^{q}\alpha_je_{t-j}^2+v_t\\[5pt] LM=n_{eff}R^2\end{gathered}

Parameters and notation

q is lag order; neff is the auxiliary regression sample size.

Structure of the method

Fit the conditional mean, square residuals, build a lagged squared-residual design, and test the joint contribution of those lags in an auxiliary regression. The LM reference evaluates predictability of conditional variance through the selected lag order; it is distinct from ordinary residual autocorrelation testing.

Estimated and nuisance parameters

Mean-model coefficients, auxiliary ARCH coefficients, and the auxiliary intercept are estimated. Effective sample size excludes unavailable initial lags. A degrees-of-freedom correction for parameters estimated in the mean model is a convention that must match the selected implementation.

Settings and design choices

Prespecify lag count, residual centering, degrees-of-freedom adjustment, and LM versus auxiliary F reporting. The example explicitly uses ddof=0; this is a teaching convention rather than a universal recommendation for fitted ARMA residuals. Searching many lags needs a joint diagnostic plan.

Fitting and adaptation

Fit a suitable mean model first and verify residual ordering. If a conditional-variance model is then fitted, assess standardized residuals and squared standardized residuals with its appropriate parameter-estimation calibration. Model-based bootstrap comparisons should refit both mean and variance stages where required.

Sensitivity and robustness

Large outliers, structural volatility breaks, misspecified mean dynamics, and heavy tails can produce apparent ARCH or invalidate moment approximations. Too many lags reduce power and usable observations. Rejection motivates variance modeling but does not establish that a particular GARCH order is correct. Nonrejection through q lags does not rule out longer or nonlinear conditional-variance dependence.

How to use and calibrate

Use χ²q asymptotically or a documented F approximation; report lag selection.

Example application

Detect volatility clustering in a time series model’s residuals.

Interpretation and pitfalls

Watch out

Unmodeled mean dynamics, outliers and structural changes can create apparent ARCH. Nonsignificance does not guarantee all conditional variance dynamics are absent.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

ARCH LM with three lags of squared residuals; uses the effective auxiliary sample size and no degrees-of-freedom correction.

Python · native

Validated — Executed successfully in the validation environment · needs numpy, scipy, statsmodels

import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
import statsmodels.api as sm
n=100
x=rng.normal(size=n); z=rng.normal(size=n); y=1+.5*x+.3*z+rng.normal(size=n)
X=sm.add_constant(np.column_stack([x,z])); fit=sm.OLS(y,X).fit(); reduced=sm.OLS(y,X[:,:2]).fit()
from statsmodels.stats.diagnostic import het_arch
print(het_arch(fit.resid,nlags=3,ddof=0))
Output
(np.float64(3.0721364887338116), np.float64(0.3806363206881535), 1.0139294943009631, 0.3902273652241769)
R

Validated — Executed successfully in the validation environment · needs Base/standard library

set.seed(2026)
n <- 100; x <- rnorm(n); z <- rnorm(n); y <- 1+.5*x+.3*z+rnorm(n)
d <- data.frame(y,x,z); fit <- lm(y~x+z,data=d); reduced <- lm(y~x,data=d)
e<-residuals(fit);q<-3;M<-embed(e^2,q+1);aux<-lm(M[,1]~M[,-1]);T<-nrow(M)*summary(aux)$r.squared;print(c(LM=T,p=pchisq(T,q,lower.tail=FALSE)))
Output
       LM         p 
5.4137121 0.1438916

Sources

Statistics guide v4 (historical):
Python: Executed successfully in the validation environment · R: Executed successfully in the validation environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Unavailable local dependencies: statsmodels. Python: Not run in the reference's review: Unavailable local dependencies: statsmodels. No installation attempted. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 193, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT193.