Skip to contents

Residual Bootstrap for the Vector Autoregressive Model with Exogenous Variables Using Lasso Regularization

Usage

RBootVARExoLasso(data, exo_mat, p, B, n_lambdas, crit, max_iter, tol)

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.

exo_mat

Numeric matrix. Matrix of exogenous variables with dimensions t by m.

p

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

B

Integer. Number of bootstrap samples to generate.

n_lambdas

Integer. Number of lambdas to generate.

crit

Character string. Information criteria to use. Valid values include "aic", "bic", and "ebic".

max_iter

Integer. The maximum number of iterations for the coordinate descent algorithm (e.g., max_iter = 10000).

tol

Numeric. Convergence tolerance. The algorithm stops when the change in coefficients between iterations is below this tolerance (e.g., tol = 1e-5).

Value

List with the following elements:

  • est: Numeric matrix. Original Lasso 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

data <- dat_p2_exo$data
exo_mat <- dat_p2_exo$exo_mat
rb <- RBootVARExoLasso(
  data = data,
  exo_mat = exo_mat,
  p = 2,
  B = 5,
  n_lambdas = 10,
  crit = "ebic",
  max_iter = 1000,
  tol = 1e-5
)
str(rb)
#> List of 4
#>  $ est : num [1:3, 1:10] 1.165 0.675 1.133 0.329 0 ...
#>  $ boot: num [1:5, 1:30] 0.841 1.339 1.409 1.564 1.025 ...
#>  $ X   : num [1:998, 1:10] 1 1 1 1 1 1 1 1 1 1 ...
#>  $ Y   :List of 5
#>   ..$ : num [1:998, 1:3] 0.812 2.929 1.375 1.644 1.555 ...
#>   ..$ : num [1:998, 1:3] 2.882 2.191 2.43 0.346 1.572 ...
#>   ..$ : num [1:998, 1:3] 2.541 1.316 -0.318 -0.566 2.054 ...
#>   ..$ : num [1:998, 1:3] 0.93 1.357 0.822 -0.137 0.492 ...
#>   ..$ : num [1:998, 1:3] 1.056 2.853 1.48 0.056 1.41 ...