ACtest: Test for Error Autocorrelation in VAR Models.

Description Usage Arguments Details Value References See Also Examples

View source: R/ACtest.R

Description

Performs LM tests for error AC in VAR models. The code is based on Paul Catani's original R code used in the paper Wild Bootstrap Tests for Autocorrelation in Vector Autoregressive Models (Ahlgren and Catani, 2016).

Usage

1
2
3
ACtest(fit, h = 4, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"), univariate = FALSE)
## S3 method for class 'ACtest'
print(x, ...)

Arguments

fit

an object of class "VARfit" that was returned by the VARfit function, or an object of class "verest" from the function "VAR" in the "vars" package.

h

the lag length of the alternative VAR(h) model for the errors.

HCtype

a vector containing some or all (default) of "LM", "HC0", "HC1", "HC2" and "HC3". The "LM" type assumes homoscedastic errors, while the "HC" types are different Heteroskedasticity-consistent tests (see 'Details').

univariate

either FALSE, TRUE, or "only". If TRUE, the test will also be performed in its univariate form, if "only", only the univariate version will be used.

x

Object with class attribute ‘ACtest’.

...

further arguments passed to or from other methods.

Details

To run the wild bootstrap version of the test, please use the output from this function with the function wildBoot.

For mathematical details of the test, see the pdf version of the manual at the package's CRAN web page.

Value

a list of class "ACtest".

fit

the fit argument object.

inputType

the type of object of fit.

HCtype

a vector of the HCtype's used.

h

the lag length of the alternative VAR(h) model for the errors.

pValues

a 1 x 5 matrix of the P. values of the tests.

Q

a 1 x 5 matrix of the Q statistics of the tests.

unipValues

a K x 5 matrix of the P. values of the univariate tests.

uniQ

a K x 5 matrix of the Q statistics of the univariate tests.

univariate

the 'univariate' argument.

description

who ran the test and when.

time

computation time taken to run the test.

call

how the function ACtest() was called.

References

Ahlgren, N. & Catani, P. (2016). Wild bootstrap tests for autocorrelation in vector autoregressive models. Stat Papers, <doi:10.1007/s00362-016-0744-0>.

Hafner, C. M. and Herwartz, H., (2009). Testing for Linear Vector Autoregressive Dynamics under Multivariate Generalized Autoregressive Heteroskedasticity. Stat Neerl, 63, 294–323

MacKinnon, J. G. and White, H. (1985). Some Heteroskedasticity Consistent Covariance Matrix Estimators with Improved Finite Sample Properties. J Econom, 29, 305–325

See Also

VARfit to estimate a VAR(p), and wildBoot to run the Wild Bootstrap versions of the tests.

Examples

1
2
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE)
test <- ACtest(fit = fit, h = 1, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"))

VARtests documentation built on May 2, 2019, 5:03 a.m.

Related to ACtest in VARtests...