Last chance! 50% off unlimited learning
Sale ends in
LiMcLeod(obj,lags=seq(5,30,5),order=0,SquaredQ=FALSE)
"numeric"
, "matrix"
,
"ts"
, or ("mts" "ts")
.
It can be also an object of fitted time-series model with class "ar"
, LiMcLeod
test.obj
is a fitted time-series model with class "ar"
,
"arima0"
, "Arima"
, "varest"
, TRUE
then apply the test on the squared values.
This checks for Autoregressive Conditional Heteroscedastic, ARCH
, effects.
When SquaredQ = FALSE
, then apply the test on the usual resik^2(lags-order)
degrees of freedom.acf
, Box.test
, BoxPierce
, LjungBox
,
Hosking
, gvtest
, portest
, GetResiduals
##############################################################
## Quarterly, west German investment, income, and consumption
## from first quarter of 1960 to fourth quarter of 1982:
##############################################################
data(WestGerman)
DiffData <- matrix(numeric(3 * 91), ncol = 3)
for (i in 1:3)
DiffData[, i] <- diff(log(WestGerman[, i]), lag = 1)
fit <- ar.ols(DiffData, intercept = TRUE, order.max = 2)
lags <- c(5,10)
## Apply the test statistic on the fitted model
LiMcLeod(fit,lags,order = 2) ## True
LiMcLeod(fit,lags) ## True
## Apply the test statistic on the residuals
res <- ts((fit$resid)[-(1:2), ])
LiMcLeod(res,lags,order = 2) ## True
LiMcLeod(res,lags) ## Not True
Run the code above in your browser using DataLab