var_forecast {multivar} | R Documentation |
Estimate h-step ahead forecasts based on the recovered transition matrix.
var_forecast(yf, h, A)
yf |
A d x T data matrix where d is the number of observed variables and T is the number of timepoints. |
h |
An integer indicating the forecast horizon. |
A |
A d x d transition matrix. |
theta <- diag(c(.7,.8,.9,.6,.7,.9)) data <- t(var_sim(100, theta, diag(.1,6))) datalag <- embed(data, 2) b <- datalag[,1:6] A <- datalag[,7:12] A_est <- fista_sparse(A, b, 1, theta, niter = 10, backtrack = TRUE)$out.x var_forecast(t(b), 2, A_est)