MCLEODLI Procedure |
@MCLEODLI performs the McLeod-Li test for nonlinearity (ARCH effects). It's a commonly used diagnostic on the standardized residuals from a GARCH model to test for remaining ARCH effects. This test is actually quite simple (it's just a CORRELATE applied to the squares of the series), but we provide this for convenience.
Note that you apply the procedure to the standardized residuals, not to their squares. (The procedure handles the squaring).
@McLeodLi( options) x start end
Parameters
|
x |
series to analyze |
|
start, end |
range to analyze. By default, the defined range of x |
Options
NUMBER=number of autocorrelations on the squares [10]
DFC=degrees of freedom correction [0]
For residuals from a univariate GARCH model, this should be the number of estimated "GARCH" parameters (those on lagged variance and lagged squared residuals).
TITLE="title for report" ["McLeod-Li Test for Series x"]
[PRINT]/NOPRINT
Variables Defined
|
%CDSTAT |
Test statistic (REAL) |
|
%SIGNIF |
Significance level of %CDSTAT (as a chi-squared) (REAL) |
|
%NOBS |
Number of observations (INTEGER) |
Example
*
* Tsay, Analysis of Financial Time Series, 3rd edition
* Example 4.3 from pp 182-184
*
open data d-ibmvwewsp6203.txt
data(format=prn,nolabels,org=columns) 1 10446 date ibm vw ew sp500
*
set r = 100.0*ibm
garch(reg,p=1,q=1,resids=u,hseries=h) / r
# constant r{2}
*
* Diagnostics
*
set ustd = u/sqrt(h)
@regcorrs(nograph,number=20,report) ustd
@mcleodli(number=10,dfc=2) ustd
@mcleodli(number=20,dfc=2) ustd
Sample Output
The 10-2 shows that the statistics were computed with 10 correlations with a degrees of freedom correction of 2. The GARCH instruction in the example uses p=1, q=1, thus the 2. You don't count the variance constant or the mean parameters for the adjustment.
McLeod-Li Test for Series USTD
Using 10444 Observations from 3 to 10446
Test Stat Signif
McLeod-Li(10-2) 13.6054773 0.09265
Copyright © 2025 Thomas A. Doan