Learn R Programming

VARtests (version 2.0.7)

cointBootTest: Bootstrap Determination of Cointegration Rank in VAR Models

Description

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).

Usage

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 cointBootTest
print(x, ...)

Value

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 r = K (for other values of r, the alpha parameters are the first r columns of this matrix).

beta

a matrix with the estimated beta parameters for the model with r = K (for other values of r, the beta parameters are the first r columns of this matrix).

gamma

a list of matrices with the estimated gamma parameters. Each parameter matrix corresponds to the model estimated under the null hypothesis in r (0:(K-1) if r = "sequence"), in the same order.

rho

a matrix with the estimated rho parameters for the model with r = K (for other values of r, the rho parameters are the first r columns of this matrix).

phi

a list of matrices with the estimated phi parameters. Each parameter matrix corresponds to the model estimated under the null hypothesis in r (0:(K-1) if r = "sequence"), in the same order.

dummy_coefs

a list of matrices with the estimated dummy parameters. Each parameter matrix corresponds to the model estimated under the null hypothesis in r (0:(K-1) if r = "sequence"), in the same order.

residuals

a list of residual matrices, one for each model estimated under the null hypothesis in r (0:(K-1) if r = "sequence"), in that order.

Q

a vector with the Q test statistics. If r = "sequence", then the first element is for the null hypothesis r = 0, and the last is for r = K - 1. Otherwise, the order corresponds to the r argument.

B.Q

a matrix of the iid bootstrap Q statistics. Each column represent the null hypothesis in the order of r (0:(K-1) if r = "sequence").

WB.Q

a matrix of the wild bootstrap Q statistics. Each column represent the null hypothesis in the order of r (0:(K-1) if r = "sequence").

B.r

the selected cointegration rank from the iid bootstrap test, if r = "sequence") were used.

WB.r

the selected cointegration rank from the wild bootstrap test, if r = "sequence") were used.

B.pv

a vector with the bootstrap P.values, in the order of r (0:(K-1) if r = "sequence").

WB.pv

a vector with the wild bootstrap P.values, in the order of r (0:(K-1) if r = "sequence").

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).

Arguments

y

a T x K matrix containing the time series.

r

either "sequence" or a vector of integers (0 <= r <= K - 1, where K is the number of columns in y). If a vector of integers, r is the cointegration rank being tested. If r = "sequence", the bootstrap sequential algorithm will be used (see 'details').

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 r = "sequence" is used, signif sets the significance level of the tests in the sequential algorithm.

dummies

(optional) dummy variables. Must have the same number of rows as y. The models will then be estimated with the dummy variables, but the dummy variables are not used in the bootstrap DGP. In the boot_type = "B" version, the residuals used to draw the bootstrap errors do not include rows corresponding to observations where any of the dummies are equal to 1.

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 TRUE, prints progress messages and an estimated completion time during the bootstrap simulation.

x

Object with class attribute ‘cointBootTest’.

...

further arguments passed to or from other methods.

Details

Consider the \(K\)-dimensional heteroskedastic cointegrated VAR model of Cavaliere, Rahbek and Taylor (2014):

$$ \Delta\mathbf{y}_{t}=\boldsymbol{\alpha}\boldsymbol{\beta}^{\prime}\mathbf{y}_{t-1}+\sum_{i=1}^{p-1}\mathbf{\Gamma}_{i}\Delta\mathbf{y}_{t-i}+\boldsymbol{\alpha}\boldsymbol{\rho}^{\prime}D_{t}+\bm{\phi}d_{t}+\bm{\varepsilon}_{t},\ \ \ \ t=1,\ldots ,T, $$

where \(\boldsymbol{\alpha}\) and \(\boldsymbol{\beta}\) are \(\left( K \times r \right)\) matrices of rank \(r<K\), the number \(r\) being the cointegration rank. \(D_{t}\) and \(d_{t}\) differ according to the model argument in the following manner:

model 1: \(D_{t}=0\) and \(d_{t}=0\) (no deterministic terms) model 2: \(D_{t}=1\) and \(d_{t}=0\) (restricted constant) model 3: \(D_{t}=1\) and \(d_{t}=1\) (restricted linear trend)

The likelihood ratio (LR) statistic for testing cointegration rank \(r\) against \(K\) is

$$ Q_{r,T}=-T\sum_{i=r+1}^{K}\text{log}( 1 - \widehat{\lambda}_{i},), $$

where the eigenvalues \(\mathbf{\widehat{\lambda}}_{1}>\ldots >\mathbf{\widehat{\lambda}}_{K}\) are the \(K\) 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 \(H(r)\) using Gaussian PMLE yielding the estimates \(\boldsymbol{\widehat{\beta}}^{(r)}\), \(\boldsymbol{\widehat{\alpha}}^{(r)}\), \(\boldsymbol{\widehat{\rho}}^{(r)}\), \(\mathbf{\widehat{\Gamma}}_{1}^{(r)},\ldots,\mathbf{\widehat{\Gamma}}_{p-1}^{(r)}\) and \(\widehat{\bm{\phi}}^{(r)}\), together with the corresponding residuals, \(\widehat{\bm{\varepsilon}}_{r,t}\). 2. Check that the equation \(| \widehat{\mathbf{A}}^{(r)}(z) |=0\), with \(\widehat{\mathbf{A}}^{(r)}(z):=(1-z)\mathbf{I}_{K}-\boldsymbol{\widehat{\alpha}}^{(r)}\boldsymbol{\widehat{\beta}}^{(r)\prime}z-\sum_{i=1}^{p-1}\mathbf{\widehat{\Gamma}}_{i}^{(r)}(1-z)z^{i}\), has \(K-r\) 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 $$ \Delta\mathbf{y}_{r,t}^{\ast}=\boldsymbol{\widehat{\alpha}}^{(r)}\boldsymbol{\widehat{\beta}}^{(r)\prime}\mathbf{y}_{r,t-1}^{\ast}+\sum_{i=1}^{p-1}\mathbf{\widehat{\Gamma}}_{i}^{(r)}\Delta\mathbf{y}_{r,t-i}^{\ast}+\boldsymbol{\widehat{\alpha}}^{(r)}\boldsymbol{\widehat{\rho}}^{(r)\prime}D_{t}+\widehat{\bm{\phi}}^{(r)}d_{t}+\bm{\varepsilon}_{r,t}^{\ast},\ \ \ \ t=1,\ldots ,T, $$ initialized at \(\mathbf{y}_{r,j}^{\ast}=\mathbf{y}_{j}, j=1-p,\ldots,0\), and with the \(T\) bootstrap errors \(\bm{\varepsilon}_{r,t}^{\ast}\) generated using the residuals \(\widehat{\bm{\varepsilon}}_{r,t}\). 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 \(\bm{\varepsilon}_{r,t}^{\ast}:=\mathbf{\widehat{\bm{\varepsilon}}}_{r,\mathcal{U}_{t}}\), where \(\mathcal{U}_{t}, t=1,\ldots ,T\) is an i.i.d. sequence of discrete uniform distributions on \(\{1,2,\ldots, T\}\). boot_type = "WB": The wild bootstrap, where for each \(t=1,\ldots ,T\), \(\bm{\varepsilon}_{r,t}^{\ast}:=\widehat{\bm{\varepsilon}}_{r,t}w_{t}\), where \(w_{t}, t=1,\ldots ,T\), is an i.i.d. sequence distributed according to the WB_dist argument. 4. Using the bootstrap sample, \(\{\mathbf{y}_{r,t}^{\ast}\}\), and denoting by \(\mathbf{\widehat{\lambda}}_{1}^{\ast}>\ldots >\mathbf{\widehat{\lambda}}_{K}^{\ast}\) the ordered solutions to the bootstrap analogue of the eigenvalue problem, compute the bootstrap LR statistic \(Q_{r,T}^{\ast}:=-T\sum_{i=r+1}^{K}\text{log}( 1 - \widehat{\lambda}_{i}^{\ast})\). Define the corresponding \(p\)-value as \(p_{r,T}^{\ast}:=1-G_{r,T}^{\ast}(Q_{r,T})\), \(G_{r,T}^{\ast}\)(.) denoting the conditional (on the original data) cdf of \(Q_{r,T}^{\ast}\). 5. The bootstrap test of \(H(r)\) against \(H(K)\) at level \(\mathbf{\eta}\) rejects \(H(r)\) if \(p_{r,T}^{\ast}\leq\mathbf{\eta}\).

If r = "sequence", the algorithm is repeated for each null hypothesis \(H(r), r=0,\ldots ,K-1\), and the first null hypothesis with a \(p_{r,T}^{\ast}>\mathbf{\eta}\) is selected as the cointegration rank. If \(p_{r,T}^{\ast}\leq\mathbf{\eta}, r=0,\ldots ,K-1\), the rank selected is \(\widehat{r}=K\).

References

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.

Examples

Run this code
# \donttest{
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")
test
# }

Run the code above in your browser using DataLab