Sparse Estimation of the Vector AutoRegressive (VAR) Model
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
)
A list with the following components
\(T\) by \(k\) matrix of time series.
Number of time series.
Maximum autoregressive lag order of the VAR.
Matrix of estimated autoregressive coefficients of the VAR.
vector of VAR intercepts.
names of time series
sparsity parameter grid
MSFE cross-validation scores for each value of the sparsity parameter in the considered grid
MSFE cross-validation full output
Optimal value of the sparsity parameter as selected by the time-series cross-validation procedure
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.
Forecast horizon h
A \(T\) by \(k\) matrix of time series. If k=1, a univariate autoregressive model is estimated.
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.
"HLag" (hierarchical sparse penalty) or "L1" (standard lasso penalty) penalization.
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.
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.
One of "none" (default), "cv" (Time Series Cross-Validation), "bic", "aic", "hq". Used to select the optimal penalization.
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".
Desired forecast horizon in time-series cross-validation procedure.
a small positive numeric value giving the tolerance for convergence in the proximal gradient algorithm.
Check whether data is standardised. Default is TRUE and is not recommended to be changed
Logical to print value of information criteria for each lambda together with selection. Default is FALSE
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.
lagmatrix and directforecast
data(var.example)
VARfit <- sparseVAR(Y = scale(Y.var)) # sparse VAR
ARfit <- sparseVAR(Y=scale(Y.var[,2])) # sparse AR
Run the code above in your browser using DataLab