hello,
I have been trying to use the predict function in the vars package to
forecast from a seasonal VAR model. The following code sample illustrates
what I am trying to do and the error that I get when trying to do it.
I run the following code, that results in the following error:
data(Canada)
endoC <- Canada[1:72,1:3]
exoC <- Canada[1:72,4]
var.2c <- VAR(endoC, p = 2, season=12,exogen=exoC,type = "const")
exoC_2 <- as.matrix(Canada[73:84,4])
predict(var.2c, n.ahead = 12,dumvar=exoC_2)
Error:
Error in as.matrix(cycle, nrow = season, ncol = season - 1) :
unused argument(s) (nrow = 12, ncol = 11)
from what I can guess, the predict.varest function is using as.matrix() and
passing nrow and ncol, as.matrix() does not take those two parameters but
matrix() does.
Does anyone have a suggestion of how to get around it? Is there a way I can
get to the predict.varest() function and alter it myself?
Thanks,
Spencer
[[alternative HTML version deleted]]