forecast_var_lasso: Forecast using VAR-lasso model

Description Usage Arguments Details Value Examples

View source: R/forecast.R

Description

forecast_var_lasso forecasts time series using VAR-lasso model

Usage

1
2
3
forecast_var_lasso(y, h = 1, model = NULL, p = 1, scale = TRUE,
  struct = "OwnOther", gran = c(25, 10), type = c("fast", "honest"),
  h_cv = 1, ...)

Arguments

y

multivariate time series

h

forecast horizon. Will be used for cross-validation in honest type.

model

estimated VAR-lasso model. If missing will be estimated automatically.

p

number of lags

scale

logical, If TRUE then time series are scaled to mean = 0 and sd = 1 before estimation. Forecasts are scaled back to original mean and sd.

struct

type of VAR-lasso

gran

granularity vector, If gran = (a, b) then cross-validation checks b values form lambda to lambda/a.

type

fast or honest cross-validation. honest: cross-validation is repeated for each h, so h should be a vector. model should be missing or a list of the same length as h or the same model for all h. fast: do cross-validation for h_cv and than predict for each horizon from 1 to h.

h_cv

forecast horizon used for cross validation. Will be used for cross-validation in fast type.

...

further arguments passed to cv.BigVAR function

Details

cv.BigVAR function from BigVAR package is used

Value

forecasts from VAR-lasso model as mforecast object

Examples

1
2
3
data(rus_macro)
y_small <- rus_macro[, c("cpi", "employment", "m2")]
var_lasso_forecast <- forecast_var_lasso(y_small, h = 2)

bdemeshev/torro documentation built on May 21, 2019, 8:36 a.m.