I estimated my model with VAR()
of the vars
package in R
. I included an exogenous variable. Now I want to forecast from my model and used predict()
. However, I got the following error.
No matrix for dumvar supplied, but object varest contains exogenous variables.
My problem is now, that I can't include my exogenous variable as the dummy, since it has no values in the future. predict()
asks for a dummy variable, which has the same number of rows as the n.ahead
prediction, though. Going through the function (see the complete one here) shows that the dummy variable is only used once:
Zdet <- as.matrix(dumvar)
forecast recursion
forecast <- matrix(NA, ncol = K, nrow = n.ahead)
lasty <- c(Zy[nrow(Zy), ])
for(i in 1 : n.ahead){
lasty <- lasty[1 : (K * p)]
Z <- c(lasty, Zdet[i, ])
forecast[i, ] <- B %*% Z
temp <- forecast[i, ]
lasty <- c(temp, lasty)
}
where B is the matrix of the estimated coefficients of the model.
Am I on the right way, if I use a zero matrix as the dummy variable?