McLeod.Li.test: McLeod-Li test
Description
Perform the McLeod-Li test for conditional heteroscedascity
(ARCH).
Usage
McLeod.Li.test(object, y, gof.lag, col = "red", omit.initial = TRUE,
plot = TRUE, ...)
Arguments
object
a fitted Arima model, ususally the output from the arima
function. If supplied, then the Mcleod-Li test is applied to the residuals
of the model, and the y-argument is ignored.
y
time series data with which one wants to test for the presence of
conditional heteroscedascity
gof.lag
maximum number of lags for which the test is carried out.
col
color of the reference line
omit.initial
suppress the initial (d+Ds) residuals if set to be TRUE
plot
suppress plotting if set to be FALSE
…
other arguments to be passed to the plot function
Value
pvlauesthe vector of p-values for the Ljung-Box test statistics
computed using the first \(m\) lags of the ACF of the squared data or residuals,
for \(m\) ranging from 1 to gof.lag.
Details
The test checks for the presence of conditional heteroscedascity by computing the
Ljung-Box (portmanteau) test with the squared data (if y is supplied and object
suppressed) or with the squared residuals from an arima model (if an arima
model is passed to the function via the object argument.)
References
McLeod, A. I. and W. K. Li (1983). Diagnostic checking ARMA time series models
using squared residual autocorrelations. Journal of Time Series Analysis, 4,
269273.
Examples
Run this code# NOT RUN {
data(CREF)
r.cref=diff(log(CREF))*100
McLeod.Li.test(y=r.cref)
# }
Run the code above in your browser using DataLab