wildBoot: Wild Bootstrap Tests for Error Autocorrelation

Description Usage Arguments Value References See Also Examples

View source: R/wildBoot.R

Description

This function runs Ahlgren and Catani's (2016) wild bootstrap (WB) test for error autocorrelation in VAR models. The function uses the test results from the function ACtest for the argument 'test', so that ACtest must be used before running wildBoot.

Usage

1
2
3
4
5
wildBoot(test, WBtype = c("recursive", "fixed"), B = 199, 
         WBdist = c("rademacher", "normal", "mammen"), 
         HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"), univariate = FALSE)
## S3 method for class 'wildBoot'
print(x, ...)

Arguments

test

An object of class ACtest.

WBtype

set this to "recursive" for the recursive version of the test, "fixed". for the fixed version, or c("recursive", "fixed") to run both versions.

B

the number of bootstrap simulations (default is 199).

WBdist

the distribution used for the wild bootstrap error terms. Either "rademacher", "normal" or "mammen".

HCtype

a vector of the HCtype's used for the WB test. The types must have been used in the test object.

univariate

either FALSE, TRUE, or "only". If TRUE, the test will also be performed univariatly, if "only", only the univariate version will be used. For TRUE and "only", the univariate version must have been used in the test object.

x

Object with class attribute ‘wildBoot’.

...

further arguments passed to or from other methods.

Value

a list of class "wildBoot".

test

the test argument object.

WBtype

the WBtype input.

B

the number of bootstrap simulations.

WBdist

the distribution used for the wild bootstrap error terms..

HCtype

the HCtype's used for the WB test.

description

who ran the function and when.

time

computation time taken to run the WB test.

call

how the function wildboot() was called.

numberOfErrors

number of times the bootstrap simulations gave an error (can happen if one of the matrices becomes computational singular). If this happens, the particular bootstrap sample will be resimulated.

numberOfNA

number of times the test from the bootstrap simulations returned NA. If this happens, the particular bootstrap sample will be resimulated.

WBr.Q

a B x 5 matrix of the recursive wild bootstrap (if used) Q statistics. Each row is the Q statistics from a bootstrap sample.

WBr.pv

the P. values from the recursive design wild bootstrap (if used).

WBf.Q

a B x 5 matrix of the fixed wild bootstrap (if used) Q statistics. Each row is the Q statistics from a bootstrap sample.

WBf.pv

the P. values from the fixed design wild bootstrap (if used).

uniList

a list of the corresponding above items (WBr.Q, WBf.Q, WBr.pv, WBf.pv) for each respective univariate test. The elemtents of the list is named "uni1WBr.Q", "uni2WBr.pv", etc.

References

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

See Also

ACtest for the test that is required to be run before the wildBoot function.

Examples

1
2
3
4
5
6
7
## Not run: 
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE)
test <- ACtest(fit = fit, h = 1, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"))
wb <- wildBoot(test = test, WBtype = "recursive", B = 199, 
               WBdist = "rademacher",  HCtype = c("LM", "HC3"))

## End(Not run)

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

Related to wildBoot in VARtests...