sparseVAR: Sparse Estimation of the Vector AutoRegressive (VAR) Model

View source: R/hvar.R

sparseVARR Documentation

Sparse Estimation of the Vector AutoRegressive (VAR) Model

Description

Sparse Estimation of the Vector AutoRegressive (VAR) Model

Usage

sparseVAR(
  Y,
  p = NULL,
  VARpen = "HLag",
  VARlseq = NULL,
  VARgran = NULL,
  selection = c("none", "cv", "bic", "aic", "hq"),
  cvcut = 0.9,
  h = 1,
  eps = 0.001,
  check_std = TRUE,
  verbose = FALSE
)

Arguments

Y

A T by k matrix of time series. If k=1, a univariate autoregressive model is estimated.

p

User-specified maximum autoregressive lag order of the VAR. Typical usage is to have the program compute its own maximum lag order based on the time series length.

VARpen

"HLag" (hierarchical sparse penalty) or "L1" (standard lasso penalty) penalization.

VARlseq

User-specified grid of values for regularization parameter corresponding to sparse penalty. Typical usage is to have the program compute its own grid. Supplying a grid of values overrides this. WARNING: use with care.

VARgran

User-specified vector of granularity specifications for the penalty parameter grid: First element specifies how deep the grid should be constructed. Second element specifies how many values the grid should contain.

selection

One of "none" (default), "cv" (Time Series Cross-Validation), "bic", "aic", "hq". Used to select the optimal penalization.

cvcut

Proportion of observations used for model estimation in the time series cross-validation procedure. The remainder is used for forecast evaluation. Redundant if selection is not "cv".

h

Desired forecast horizon in time-series cross-validation procedure.

eps

a small positive numeric value giving the tolerance for convergence in the proximal gradient algorithm.

check_std

Check whether data is standardised. Default is TRUE and is not recommended to be changed

verbose

Logical to print value of information criteria for each lambda together with selection. Default is FALSE

Value

A list with the following components

Y

T by k matrix of time series.

k

Number of time series.

p

Maximum autoregressive lag order of the VAR.

Phihat

Matrix of estimated autoregressive coefficients of the VAR.

phi0hat

vector of VAR intercepts.

series_names

names of time series

lambdas

sparsity parameter grid

MSFEcv

MSFE cross-validation scores for each value of the sparsity parameter in the considered grid

MSFEcv_all

MSFE cross-validation full output

lambda_opt

Optimal value of the sparsity parameter as selected by the time-series cross-validation procedure

lambda_SEopt

Optimal value of the sparsity parameter as selected by the time-series cross-validation procedure and after applying the one-standard-error rule. This is the value used.

h

Forecast horizon h

References

Nicholson William B., Wilms Ines, Bien Jacob and Matteson David S. (2020), “High-dimensional forecasting via interpretable vector autoregression”, Journal of Machine Learning Research, 21(166), 1-52.

See Also

lagmatrix and directforecast

Examples

data(var.example)
VARfit <- sparseVAR(Y = scale(Y.var)) # sparse VAR
ARfit <- sparseVAR(Y=scale(Y.var[,2])) # sparse AR

bigtime documentation built on Aug. 22, 2023, 1:08 a.m.