Learn R Programming

portes (version 1.04)

GVStat: Generalized Variance Portmanteau Test

Description

New generalized variance portmanteau test, based on the determinant of the Hosking's autocorrelation block Toeplitz matrix with order $m+1$ given in the function blockToeplitz, where $m$ represents the order of the block matrix.

Usage

GVStat(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 test statistic and its associated p-values for different lags based on asymptotic chi-square distribution with k^2(lags-order) degrees of freedom.

References

Pena, D. and Rodriguez, J. (2002). "A Powerful Portmanteau Test of Lack of Test for Time Series". Journal of American Statistical Association, 97, 601-610. Mahdi, E. and McLeod, A.I. (2010). "Improved multivariate portmanteau diagnostic test". Submitted.

See Also

acf, Box.test, BoxPierce, LjungBox, Hosking, LiMcLeod, blockToeplitz, portes, Get.Resid

Examples

Run this code
##############################################################
## Measurements of the annual flow of the river Nile at Aswan 
## from the years 1871 to 1970:
##############################################################
fit <- arima(Nile, c(2, 0, 0))
lags <- c(5, 10, 20)
## Apply the test statistic on the fitted model 
GVStat(fit, lags, order = 2)  ## Univariate GVStat test
## Apply the test statistic on the residuals
res <- resid(fit)
GVStat(res, lags, order = 2)  ## Univariate GVStat test
##############################################################
## 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 
GVStat(fit,lags,order = 2)  ## Multivariate GVStat test
## Apply the test statistic on the residuals
res <- ts((fit$resid)[-(1:2), ])
GVStat(res,lags,order = 2)  ## Multivariate GVStat test
##############################################################
## Monthly log stock returns of Intel corporation data
## Test for ARCH Effects 
##############################################################
monthintel <- as.ts(monthintel)
GVStat(monthintel,SquaredQ=FALSE) ## Test for usual residuals   
GVStat(monthintel,SquaredQ=TRUE)  ## Test for ARCH effects

Run the code above in your browser using DataLab