MCLEODLI - procedure for McLeod-Li test for nonlinearity
This is a procedure for doing 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. McLeod and Li(1983), "Diagnostic Checking of ARMA Time Series Models Using Squared Residual Autocorrelations", J. of Time Series Analysis, vol 4, pp 269-273. 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
Options
NUMBER=number of autocorrelations on the squares [10]
DFC=degrees of freedom correction [0]. For residuals from a GARCH model, this should be the number of estimated "GARCH" parameters (those on lagged variance and lagged squared residuals).
TITLE=title of report ["McLeod-Li Test for Series x"]
[PRINT]/NOPRINT
Example
@McLeodLi( options) x start end
Parameters
| x | series to analyze |
| start end | range to analyze [defaults to full range of x] |
Options
NUMBER=number of autocorrelations on the squares [10]
DFC=degrees of freedom correction [0]. For residuals from a GARCH model, this should be the number of estimated "GARCH" parameters (those on lagged variance and lagged squared residuals).
TITLE=title of report ["McLeod-Li Test for Series x"]
[PRINT]/NOPRINT
Example
- Code: Select all
*
* 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