Learn R Programming

portes (version 1.04)

LiMcLeod: The Modified Multivariate Portmanteau Test, Li-McLeod (1981)

Description

The modified multivariate portmanteau test suggested by Li and McLeod (1981).

Usage

LiMcLeod(obj,lags=seq(5,30,5),order=0,SquaredQ=FALSE)

Arguments

obj
a fitted time-series model with any of the classes "ar", "Arima", "arima0", "FitAR", or "FitFGN" or a residuals with class "ts", "numeric", "matrix"<
lags
vector of lag values.
order
$p+q$, where ($p$,$q$) is the ARMA or the VARMA order.
SquaredQ
TRUE, apply the test to the squared values. This is needed to check the Autoregressive Conditional Heteroscedastic, ARCH, effects. When SquaredQ = FALSE, apply for the usual residuals.

Value

  • The multivariate test statistic suggested by Li and McLeod (1981) and its corresponding p-values for different lags based on asymptotic chi-square distribution with k^2(lags-order) degrees of freedom.

References

Li, W. K. and McLeod, A. I. (1981). "Distribution of The Residual Autocorrelations in Multivariate ARMA Time Series Models". Journal of The Royal Statistical Society, Series B, 43, 231-239.

See Also

acf, Box.test, BoxPierce, LjungBox, Hosking,GVStat, portes, Get.Resid

Examples

Run this code
##############################################################
## 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)  
## Apply the test statistic on the residuals
res <- ts((fit$resid)[-(1:2), ])
LiMcLeod(res,lags,order = 2)

Run the code above in your browser using DataLab