powered by
Function to obtain h-step ahead direct forecast based on estimated VAR, VARX or VARMA model
directforecast(fit, h = 1)
Vector of length k containing the h-step ahead forecasts for the k time series.
Fitted sparse VAR, VARX or VARMA model.
Desired forecast horizon. Default is h=1.
data(var.example) VARfit <- sparseVAR(Y=scale(Y.var), selection = "cv") # sparse VAR VARforecast <- directforecast(fit=VARfit, h=1)
Run the code above in your browser using DataLab