| recursiveforecast | R Documentation |
Recursively forecasts a VAR estimated using sparseVAR. lambda can either be NULL, in which case all lambdas that were used for model estimation are used for forecasting, or a single value, in which case only the model using this lambda will be used for forecasting.
recursiveforecast(mod, h = 1, lambda = NULL)
mod |
VAR model estimated using |
h |
Desired forecast horizon. Default is h=1. |
lambda |
Either |
Returns an object of S3 class bigtime.recursiveforecast containing
fcst |
Matrix or 3D array of forecasts |
h |
Selected forecast horizon |
lambda |
List of lambdas for which the forecasts were made |
Y |
Data used for recursive forecasting |
sim_data <- simVAR(periods=200, k=5, p=5, seed = 12345) summary(sim_data) mod <- sparseVAR(Y=scale(sim_data$Y), selection = "bic") is.stable(mod) fcst_recursive <- recursiveforecast(mod, h = 4) plot(fcst_recursive, series = "Y1") fcst_direct <- directforecast(mod) fcst_direct fcst_recursive$fcst