MCLEODLI - procedure for McLeod-Li test for nonlinearity

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.

MCLEODLI - procedure for McLeod-Li test for nonlinearity

Postby TomDoan » Wed Jul 02, 2008 9:07 am

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.src
Procedure file - requires RATS 7.3 or later
(2.17 KiB) Downloaded 47 times


@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
Attachments
d-ibmvwewsp6203.txt
Data file for example
(581.47 KiB) Downloaded 27 times
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 3 guests