Skip to contents

Residual Bootstrap for the Vector Autoregressive Model Using Ordinary Least Squares

Usage

RBootVAROLS(data, p, B)

Arguments

data

Numeric matrix. The time series data with dimensions t by k, where t is the number of observations and k is the number of variables.

p

Integer. The order of the VAR model (number of lags).

B

Integer. Number of bootstrap samples to generate.

Value

List with the following elements:

  • est: Numeric matrix. Original OLS estimate of the coefficient matrix.

  • boot: Numeric matrix. Matrix of vectorized bootstrap estimates of the coefficient matrix.

  • X: Numeric matrix. Original X

  • Y: List of numeric matrices. Bootstrapped Y

Author

Ivan Jacob Agaloos Pesigan

Examples

rb <- RBootVAROLS(data = dat_p2, p = 2, B = 5)
str(rb)
#> List of 4
#>  $ est : num [1:3, 1:7] 0.79 1.0002 1.0667 0.3684 0.0133 ...
#>  $ boot: num [1:5, 1:21] 1.017 0.733 0.991 0.909 0.583 ...
#>  $ X   : num [1:998, 1:7] 1 1 1 1 1 1 1 1 1 1 ...
#>  $ Y   :List of 5
#>   ..$ : num [1:998, 1:3] 1.077 1.436 1.43 1.545 0.847 ...
#>   ..$ : num [1:998, 1:3] 1.129 0.644 0.399 1.188 -0.688 ...
#>   ..$ : num [1:998, 1:3] 0.873 1.291 1.201 0.713 1.825 ...
#>   ..$ : num [1:998, 1:3] 2.9608 2.7655 -0.0879 1.5491 1.9377 ...
#>   ..$ : num [1:998, 1:3] 0.0328 -0.5807 0.4307 3.439 2.4781 ...