| Title: | Bootstrap Tests for Cointegration and Autocorrelation in VARs |
|---|---|
| Description: | Implements wild bootstrap tests for autocorrelation in Vector Autoregressive (VAR) models based on Ahlgren and Catani (2016) <doi:10.1007/s00362-016-0744-0>, a combined Lagrange Multiplier (LM) test for Autoregressive Conditional Heteroskedasticity (ARCH) in VAR models from Catani and Ahlgren (2016) <doi:10.1016/j.ecosta.2016.10.006>, and bootstrap-based methods for determining the cointegration rank from Cavaliere, Rahbek, and Taylor (2012) <doi:10.3982/ECTA9099> and Cavaliere, Rahbek, and Taylor (2014) <doi:10.1080/07474938.2013.825175>. |
| Authors: | Markus Belfrage [aut, cre], Paul Catani [ctb], Niklas Ahlgren [ctb] |
| Maintainer: | Markus Belfrage <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 2.0.7 |
| Built: | 2026-05-24 07:46:30 UTC |
| Source: | https://github.com/cran/VARtests |
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).
ACtest(fit, h = 4, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"), univariate = FALSE) ## S3 method for class 'ACtest' print(x, ...)ACtest(fit, h = 4, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"), univariate = FALSE) ## S3 method for class 'ACtest' print(x, ...)
fit |
an object of class |
h |
the lag length of the alternative VAR(h) model for the errors. |
HCtype |
a vector containing some or all (default) of |
univariate |
either |
x |
Object with class attribute ‘ACtest’. |
... |
further arguments passed to or from other methods. |
To run the wild bootstrap version of the test, please use the output from this function with the function wildBoot.
Mathematical details
The tests for error AC are based on the least squares (LS) residuals from the
-dimensional vector autoregressive (VAR) model with lags (abstracting from
deterministic terms):
The LS residuals are
where are
the LS estimates of the parameter matrices .
The LM statistic is computed from the auxilary model
=(\mathbf{Z}_{t-1}^{\prime }\otimes \mathbf{I}_{K})\boldsymbol{\phi }+(\widehat{%
\mathbf{U}}_{t-1}^{\prime }\otimes \mathbf{I}_{K})\boldsymbol{\psi }+\mathbf{e}%
_{t}, \
where , , and . The symbol denotes the Kronecker product and
the symbol vec denotes the column vectorisation operator. The first
values of the residuals are set to zero in the
auxiliary model, so that the series length is equal to the series length in
the original VAR model.
The LM statistic for error AC of order is given by
where is the LS estimate of and is the block of
corresponding to . Here is the estimator of the error covariance matrix from the
VAR model.
The multivariate heteroskedasticity-consistent covariance matrix estimator (HCCME) for the auxilary model is given by (Hafner and Herwartz 2009)
where
The HCCME-based LM statistics for error AC are obtained from the expression for
by replacing by the block of corresponding to and with defined by , , and , respectively.
uses .
multiplies the elements of by
.
replaces by , where is the th
diagonal element of , and .
replaces by .
See MacKinnon and White (1985) for details.
The recursive-design wild bootstrap (WB) tests for error AC are computed using Algorithm 1 in Ahlgren and Catani (2016). The Fixed-design WB tests for error AC are computed using Algorithm 2 in Ahlgren and Catani (2016).
a list of class "ACtest".
fit |
the |
inputType |
the type of object of |
HCtype |
a vector of the |
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 |
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
VARfit to estimate a VAR(p), and wildBoot to run the Wild Bootstrap versions of the tests.
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) test <- ACtest(fit = fit, h = 1, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3")) testfit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) test <- ACtest(fit = fit, h = 1, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3")) test
Performs the bootstrap combined Lagrange multiplier (LM) test for autoregressive conditional heteroskedastic (ARCH) errors in vector autoregressive (VAR) models of Catani and Ahlgren (2016).
The tests of Eklund and Teräsvirta (2007), as well as the Multivariate LM test for ARCH as described for example in Lütkepohl (2006, sect. 16.5), are also included if the arguments ET respectively MARCH are set to TRUE. The bootstrap procedure for those are the same as in Catani and Ahlgren (2016).
archBootTest(fit, h = 2, B = 499, CA = TRUE, ET = TRUE, MARCH = TRUE, dist = "norm", skT.param = c(0, 1, 0, 5), verbose = TRUE) ## S3 method for class 'archBootTest' print(x, ...)archBootTest(fit, h = 2, B = 499, CA = TRUE, ET = TRUE, MARCH = TRUE, dist = "norm", skT.param = c(0, 1, 0, 5), verbose = TRUE) ## S3 method for class 'archBootTest' print(x, ...)
fit |
an object of class |
h |
the lag length of the alternative VAR(h) model for the errors. |
B |
the number of bootstrap simulations. |
CA |
if |
ET |
if |
MARCH |
if |
dist |
the error distribution. Either |
skT.param |
a vector of four parameters for the skew-t distribution in case |
verbose |
logical; if |
x |
Object with class attribute ‘archBootTest’. |
... |
further arguments passed to or from other methods. |
All tests for ARCH are based on Cholesky-standardised least squares (LS)
residuals from the -dimensional vector autoregressive (VAR) model with
lags (abstracting from deterministic terms):
The LS residuals are
where are
the LS estimates of the parameter matrices . The multivariate LS residuals are , which is an matrix. The Cholesky-standardised LS
residuals are
where is the Cholesky factor of , i.e. is the (unique) upper triangular matrix such that
The LM test for ARCH of order (Engle 1982) in equation , , is a test of against
for at least one in the auxiliary regression
The LM statistic has the form
where is from the auxiliary regression for equation .
The combined LM statistic (Dufour et al. 2010, Catani and Ahlgren 2016) is given by
where is the -value of the statistic, derived from
the asymptotic distibution. The test is only available as a
bootstrap test. The bootstrap -value is simulated using Bootstrap
Algorithm 1 of Catani and Ahlgren (2016) if the errors are normal,
and Bootstrap Algorithm 2 if the errors are skew- (by setting the function argument dist = "skT"),
where is the skewness parameter and is the degrees-of-freedom
parameter of the skew- distribution. These parameters can be set with the skT.param argument.
The multivariate LM test for ARCH of order is a generalisation of the
univariate test, and is based on the auxiliary regression
where is the half-vectorisation operator. The null hypothesis is against for at least one The
multivariate LM statistic has the form
where is the estimator of the
error covariance matrix from the auxiliary regression and is the estimator of the error covariance matrix
from the VAR model (see Lütkepohl 2006, sect. 16.5). The statistic
is asymptotically distributed as . The test is
available as an asymptotic test using the asymptotic distribution to derive the -value, and as a
bootstrap test. The bootstrap -value is simulated using Bootstrap
Algorithms 1 and 2 of Catani and Ahlgren (2016). The asymptotic validity of
the bootstrap multivariate LM test has not been established.
The Eklund and Teräsvirta (2007) LM test of constant error covariance
matrix assumes the alternative hypothesis is a constant conditional
correlation autoregressive conditional heteroskedasticity (CCC-ARCH) process
of order : , where is a diagonal matrix of conditional
standard deviations of the errors and , , is a positive definite matrix of conditional
correlations. The conditional variance is assumed to follow a CCC-ARCH process:
where is a -dimensional vector of positive constants, are diagonal matrices and .
The null hypothesis
is against for at least one . The LM statistic has the form
where and are the score vector and information matrix,
respectively, estimated under the null hypothesis (see Eklund and Teräsvirta
2007 for details). The asymptotic distribution of the
statistic is . The test is available as an asymptotic test using
the asymptotic distribution to derive the -value, and as a
bootstrap test. The bootstrap -value is simulated using Bootstrap
Algorithms 1 and 2 of Catani and Ahlgren (2016). The asymptotic validity of
the bootstrap test has not been established.
a list of class "ACtest".
fit |
the |
inputType |
the type of object of |
h |
the lag length h of the alternative VAR(h) model for the errors. |
B |
the number of bootstrap simulations. |
K |
the number of series/equations in the fitted VAR model. |
CA |
the |
ET |
the |
MARCH |
the |
dist |
the |
standardizedResi |
the Cholesky-standardized residuals. |
CA_LM |
the combined LM statistic of Catani and Ahlgren (2016), computed as 1 - min(P( |
CA_bootPV |
the bootstrap P. value of the combined LM test of Catani and Ahlgren (2016). |
CA_LMi |
the LM statistics of Catani and Ahlgren (2016) for each time series. |
CA_LMijStar |
an (N-p) x K matrix of the bootstrap LM statistics for each time series (columns) and bootstrap sample (rows), for the Catani and Ahlgren (2016) test. |
CA_uniBootPV |
a vector of length K with the univariate bootstrap P. values for each time series, for the Catani and Ahlgren (2016) test. |
ET_LM |
the LM statistic of the Eklund and Teräsvirta (2007) test. |
ET_PV |
the P.value of the Eklund and Teräsvirta (2007) LM test statistic. |
ET_bootPV |
the bootstrap P.value of the Eklund and Teräsvirta (2007) test. |
ET_LMStar |
the bootstrap LM test statistics for the Eklund and Teräsvirta (2007) test. |
MARCH_LM |
the LM statistic of the Multivariate LM test for ARCH. See e.g. Lütkepohl (2006, sect. 16.5). |
MARCH_PV |
the P.value of the MARCH LM test statistic. |
MARCH_bootPV |
the bootstrap P.value of the MARCH test. |
MARCH_LMStar |
the bootstrap LM test statistics for the MARCH test. |
description |
who ran the test and when. |
time |
computation time taken to run the test. |
call |
how the function |
Catani, P. and Ahlgren, N. (2016). Combined Lagrange multiplier test for ARCH in vector autoregressive models, Economics and Statistics, <doi:10.1016/j.ecosta.2016.10.006>.
Dufour, J.-M., Khalaf, L., and Beaulieu, M.-C. (2010). Multivariate residual-based finite-sample tests for serial dependence and arch effects with applications to asset pricing models, Journal of Applied Econometrics, 25 (2010) 263–285.
Eklund, B. and Teräsvirta, T. (2007). Testing constancy of the error covariance matrix in vector models, Journal of Econometrics, 140, 753-780.
Engle, R.F. (1982). Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation, Econometrica, 50, 987-1007.
Lütkepohl, H. (2006), New Introduction to Multiple Time Series Analysis, Springer, New York.
VARfit to estimate a VAR(p).
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) test <- archBootTest(fit = fit, h = 5, B = 199, CA = TRUE, ET = TRUE, MARCH = TRUE, dist = "norm") testfit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) test <- archBootTest(fit = fit, h = 5, B = 199, CA = TRUE, ET = TRUE, MARCH = TRUE, dist = "norm") test
This function uses the bootstrap and wild bootstrap to test the cointegration rank of a VAR model. The test is an implementation of Cavaliere, Rahbek & Taylor (2012, 2014), and is used in Ahlgren & Catani (2018).
cointBootTest(y, r = "sequence", p, model = 1, signif = 0.05, dummies = NULL, B = 999, boot_type = c("B", "WB"), WB_dist = c("rademacher", "normal", "mammen"), verbose = TRUE) ## S3 method for class 'cointBootTest' print(x, ...)cointBootTest(y, r = "sequence", p, model = 1, signif = 0.05, dummies = NULL, B = 999, boot_type = c("B", "WB"), WB_dist = c("rademacher", "normal", "mammen"), verbose = TRUE) ## S3 method for class 'cointBootTest' print(x, ...)
y |
a T x K matrix containing the time series. |
r |
either |
p |
the lag order of the model. |
model |
either 1 (no deterministic terms), 2 (restricted constant), or 3 (restricted linear trend). See 'details' below. |
signif |
if |
dummies |
(optional) dummy variables. Must have the same number of rows as |
B |
the number of bootstrap replications. |
boot_type |
either "B", "WB", or both. "B" uses the iid bootstrap algorithm, while "WB" uses the wild bootstrap algorithm. |
WB_dist |
The distribution used for the wild bootstrap. Either "rademacher", "normal", or "mammen". |
verbose |
logical; if |
x |
Object with class attribute ‘cointBootTest’. |
... |
further arguments passed to or from other methods. |
Consider the -dimensional heteroskedastic cointegrated VAR model of Cavaliere,
Rahbek and Taylor (2014):
where and are matrices of rank , the number being the cointegration rank. and differ according to the model argument in the following manner:
model 1: and (no deterministic
terms)
model 2: and (restricted constant)
model 3: and (restricted linear trend)
The likelihood ratio (LR) statistic for testing cointegration rank against is
where the eigenvalues are the largest solutions to a certain eigenvalue
problem (see Johansen 1996).
Bootstrap and wild bootstrap algorithm of Cavaliere, et al. (2012, 2014):
1. Estimate the model under using Gaussian PMLE yielding the estimates , ,
, and , together with the corresponding residuals, .
2. Check that the equation , with , has roots equal to 1 and all other roots outside the unit circle. If so, procede to step 3.
3. Construct the bootstrap sample recursively from
initialized at , and with the bootstrap errors generated using the residuals . The bootstrap errors are generated depending on the boot_type argument in the following manner:
boot_type = "B": The i.i.d. bootstrap, such that , where is an i.i.d. sequence of discrete uniform distributions on .
boot_type = "WB": The wild bootstrap, where for each , , where , is an i.i.d. sequence distributed according to the WB_dist argument.
4. Using the bootstrap sample, , and denoting by the ordered solutions to the bootstrap analogue of the eigenvalue problem, compute the bootstrap LR statistic . Define the corresponding -value as , (.) denoting the conditional (on the original data) cdf of .
5. The bootstrap test of against at level rejects if .
If r = "sequence", the algorithm is repeated for each null hypothesis , and the first null hypothesis with a is selected as the cointegration rank. If , the rank selected is .
a list of class "cointBootTest".
eigen_val |
the eigenvalues. |
eigen_vec |
the eigenvectors. |
alpha |
a matrix with the estimated alpha parameters for the model with |
beta |
a matrix with the estimated beta parameters for the model with |
gamma |
a list of matrices with the estimated gamma parameters. Each parameter matrix corresponds to the model estimated under the null hypothesis in |
rho |
a matrix with the estimated rho parameters for the model with |
phi |
a list of matrices with the estimated phi parameters. Each parameter matrix corresponds to the model estimated under the null hypothesis in |
dummy_coefs |
a list of matrices with the estimated dummy parameters. Each parameter matrix corresponds to the model estimated under the null hypothesis in |
residuals |
a list of residual matrices, one for each model estimated under the null hypothesis in |
Q |
a vector with the Q test statistics. If |
B.Q |
a matrix of the iid bootstrap Q statistics. Each column represent the null hypothesis in the order of |
WB.Q |
a matrix of the wild bootstrap Q statistics. Each column represent the null hypothesis in the order of |
B.r |
the selected cointegration rank from the iid bootstrap test, if |
WB.r |
the selected cointegration rank from the wild bootstrap test, if |
B.pv |
a vector with the bootstrap P.values, in the order of |
WB.pv |
a vector with the wild bootstrap P.values, in the order of |
B.errors |
the number of times the bootstrap simulations had to be resimulated due to errors. |
WB.errors |
the number of times the wild bootstrap simulations had to be resimulated due to errors. |
companion_eigen |
a list of matrices with the eigenvalues of the companion matrix. The inverse of the eigenvalues are the roots in step 2 of the boostrap algorithm (see the .pdf version of this help file). |
Ahlgren, N. & Catani, P. (2018). Practical Problems with Tests of Cointegration Rank with Strong Persistence and Heavy-Tailed Errors. In Corazza, M., Durábn, M., Grané, A., Perna, C., Sibillo, M. (eds) Mathematical and Statistical Methods for Actuarial Sciences and Finance, Cham, Springer.
Cavaliere, G., Rahbek, A., & Taylor, A. M. R. (2012). Bootstrap determination of the co-integration rank in vector autoregressive models, Econometrica, 80, 1721-1740.
Cavaliere, G., Rahbek, A., & Taylor, A. M. R. (2014). Bootstrap determination of the co-integration rank in heteroskedastic VAR models, Econometric Reviews, 33, 606-650.
Johansen, S. (1996). Likelihood-based inference in cointegrated vector autoregressive models, Oxford, Oxford University Press.
test <- cointBootTest(y = VodafoneCDS, r = "sequence", p = 2, model = 3, signif = 0.05, dummies = NULL, B = 999, boot_type = c("B", "WB"), WB_dist = "rademacher") testtest <- cointBootTest(y = VodafoneCDS, r = "sequence", p = 2, model = 3, signif = 0.05, dummies = NULL, B = 999, boot_type = c("B", "WB"), WB_dist = "rademacher") test
The data matrix VodafoneCDS is used for the examples. It consists of 804 daily observations, from 1 January 2009 to 31 January 2012, of Vodafone's Credit Default Swap prices (the 'CDS' column) and the credit spread on its bond over the risk-free rate (the 'SWSP' column). For more information, see Ahlgren and Catani (2016), who used the same data set.
Ahlgren, N. & Catani, P. (2016). Wild bootstrap tests for autocorrelation in vector autoregressive models. Stat Papers, <doi:10.1007/s00362-016-0744-0>.
Estimates a VAR(p) model from data. The function's purpose is to be used before the ACtest or archBootTest functions, and doesn't have the same full functionality as for example the function vars::VAR in the vars package.
VARfit(y, p = 1, const = TRUE, trend = FALSE, exogen = NULL, univariate = FALSE)VARfit(y, p = 1, const = TRUE, trend = FALSE, exogen = NULL, univariate = FALSE)
y |
an N x K matrix containing the time series to be modeled. |
p |
the lag length of the VAR(p) process. |
const |
if |
trend |
if |
exogen |
a matrix or vector of exogenous variable(s). Must have the same number of rows as 'y' does. |
univariate |
if |
a list of class "VARfit" with the following slots:
y |
the data matrix. |
p |
the lag length |
N |
the the number of observations/rows in the time series 'y'. |
K |
the the number of variables in the time series 'y'. |
const |
|
trend |
|
exogen |
the exogen variable(s). |
Z |
the [N - p] x [Kp + numberOf(const, trend, dummy)] design matrix, where the lags of the |
call |
how the function |
coef |
a matrix of the estimated parameters. |
resid |
the [N - p] x K matrix of residuals. |
uniCoef |
a matrix of the estimated parameter for the univariate case (an AR(p) for each column in 'y'). |
uniResid |
the [N - p] x K matrix of residuals from the univariate (AR(p)) cases. |
univariate |
the 'univariate' argument. |
NnonLagVar |
the number of non-endogenous variables (i.e. the number of 'exogen' variables + const + trend). |
description |
who fitted the model and when. |
time |
computation time taken for the estimation. |
ACtest to test for error autocorrelations, and archBootTest to test for ARCH errors.
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) fitfit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) fit
VARfit
residuals.VARfit() returns the residuals, and coef.VARfit() returns the coefficients of a fitted VAR model of class VARfit. print.VARfit() prints the estimated model parameters.
## S3 method for class 'VARfit' coef(object, ...) ## S3 method for class 'VARfit' print(x, ...) ## S3 method for class 'VARfit' residuals(object, ...)## S3 method for class 'VARfit' coef(object, ...) ## S3 method for class 'VARfit' print(x, ...) ## S3 method for class 'VARfit' residuals(object, ...)
x, object
|
A fitted VAR model of class |
... |
Additional arguments passed to the methods. |
coef.VARfit: A numeric matrix containing the estimated coefficients of the VAR model, including intercepts and lagged autoregressive terms.
print.VARfit: No return value. Called for its side effects (printing model information to the console).
residuals.VARfit: A numeric matrix of residuals from the fitted VAR model. Each column corresponds to one of the time series in the system.
This function simulates VAR(p) series. For quick use, the function can use the estimated
model returned by VARfit or vars::VAR as
the DGP (Data Generating Process), if passed to the fittedModel argument.
VARsim(N = 200, K = 2, p = 1, const = TRUE, trend = FALSE, exogen = NULL, coef = NULL, dist = "normal", Ystart = NULL, errors = NULL, fittedModel = NULL)VARsim(N = 200, K = 2, p = 1, const = TRUE, trend = FALSE, exogen = NULL, coef = NULL, dist = "normal", Ystart = NULL, errors = NULL, fittedModel = NULL)
N |
The length of the series. |
K |
The number of series/equations. |
p |
The lag length of the VAR(p). |
const |
if |
trend |
if |
exogen |
a matrix of exogenous variables. Should either have |
coef |
a matrix of coefficients.
E.g. a 2 dimensional VAR(2) with a constant, a trend and one exogenous variable must be entered in the following order (the same as returned by
|
dist |
the distribution of the error terms (currently only |
Ystart |
a |
errors |
(optional) a matrix of error terms. If supplied, |
fittedModel |
(optional) either an object of class |
an N x K matrix of the simulated VAR(p).
# Simulates from a fitted DGP: fit <- VARfit(y = VodafoneCDS, p = 1, const = TRUE) y <- VARsim(fittedModel = fit) VARfit(y = y, p = 1, const = TRUE) # Simulates from user given parameters. # Includes an exogenous variable: VARcoef <- matrix(c(1, 2, 1, 0.5, 0.1, 0.3, 0.2, 0.5), ncol = 2, byrow = TRUE) exo <- matrix(rnorm(500)) y <- VARsim(N = 500, K = 2, p = 1, const = TRUE, trend = FALSE, exogen = exo, coef = VARcoef, dist = "normal") VARfit(y = y, p = 1, const = TRUE, exogen = exo)# Simulates from a fitted DGP: fit <- VARfit(y = VodafoneCDS, p = 1, const = TRUE) y <- VARsim(fittedModel = fit) VARfit(y = y, p = 1, const = TRUE) # Simulates from user given parameters. # Includes an exogenous variable: VARcoef <- matrix(c(1, 2, 1, 0.5, 0.1, 0.3, 0.2, 0.5), ncol = 2, byrow = TRUE) exo <- matrix(rnorm(500)) y <- VARsim(N = 500, K = 2, p = 1, const = TRUE, trend = FALSE, exogen = exo, coef = VARcoef, dist = "normal") VARfit(y = y, p = 1, const = TRUE, exogen = exo)
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.
wildBoot(test, WBtype = c("recursive", "fixed"), B = 199, WBdist = c("rademacher", "normal", "mammen"), HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"), univariate = FALSE, verbose = TRUE) ## S3 method for class 'wildBoot' print(x, ...)wildBoot(test, WBtype = c("recursive", "fixed"), B = 199, WBdist = c("rademacher", "normal", "mammen"), HCtype = c("LM", "HC0", "HC1", "HC2", "HC3"), univariate = FALSE, verbose = TRUE) ## S3 method for class 'wildBoot' print(x, ...)
test |
An object of class |
WBtype |
set this to |
B |
the number of bootstrap simulations (default is 199). |
WBdist |
the distribution used for the wild bootstrap error terms. Either |
HCtype |
a vector of the |
univariate |
either |
verbose |
logical; if |
x |
Object with class attribute ‘wildBoot’. |
... |
further arguments passed to or from other methods. |
a list of class "wildBoot".
test |
the |
WBtype |
the |
B |
the number of bootstrap simulations. |
WBdist |
the distribution used for the wild bootstrap error terms.. |
HCtype |
the |
description |
who ran the function and when. |
time |
computation time taken to run the WB test. |
call |
how the function |
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 ( |
Ahlgren, N. & Catani, P. (2016). Wild bootstrap tests for autocorrelation in vector autoregressive models. Stat Papers, <doi:10.1007/s00362-016-0744-0>.
ACtest for the test that is required to be run before the wildBoot function.
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) test <- ACtest(fit = fit, h = 1, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3")) test wb <- wildBoot(test = test, WBtype = "recursive", B = 199, WBdist = "rademacher", HCtype = c("LM", "HC3")) wbfit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE) test <- ACtest(fit = fit, h = 1, HCtype = c("LM", "HC0", "HC1", "HC2", "HC3")) test wb <- wildBoot(test = test, WBtype = "recursive", B = 199, WBdist = "rademacher", HCtype = c("LM", "HC3")) wb