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

Description Usage Arguments Value References See Also Examples

Description

Sparse Estimation of the Vector AutoRegressive (VAR) Model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sparseVAR(
  Y,
  p = NULL,
  VARpen = "HLag",
  VARlseq = NULL,
  VARgran = NULL,
  cv = TRUE,
  cvcut = 0.9,
  h = 1,
  eps = 0.001
)

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.

cv

Logical, whether time-series cross-validation needs to be performed (TRUE) or not (FALSE) for selecting the sparsity parameter. If cv=FALSE, the argument cvcut is redundant.

cvcut

Proportion of observations used for model estimation in the time series cross-validation procedure. The remainder is used for forecast evaluation.

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.

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., Bien Jacob and Matteson David S. (2017), "High-dimensional forecasting via interpretable vector autoregression," Journal of Machine Learning Research, 21(166), 1-52.

See Also

lagmatrix and directforecast

Examples

1
2
3
data(Y)
VARfit <- sparseVAR(Y) # sparse VAR
ARfit <- sparseVAR(Y[,2]) # sparse AR

YiHou98/bigtime documentation built on Dec. 18, 2021, 7:26 p.m.