After generating the restricted coefficient matrix restrict
, you can use predict
on restrict(...)
since restrict(...)
also returns an object of class varest
:
##Attempt to Restrict VAR Coefficients
##VAR has 5 lags with three variables plus constant and 11 seasonal dummies.
library("vars")
var1 <- VAR(DVARmat, p = 5, type ="const", season = 12)
restrict <- matrix (c(1,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0,
1,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0,
1,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0),
nrow = 3, ncol = 27, byrow = T)
var1_restrict <- coef(restrict(var1, method ="man", resmat = restrict))
var1_restrict
expostrestrict <- predict(restrict(var1, method="man", resmat = restrict), n.ahead = 13, ci=.95)
Note that restrict(var1, method="man", resmat = restrict)
is an object that could be generated, thus if one prefers they may also use the following :
restrict_var <- restrict(var1, method="man", resmat = restrict)
expostrestrict <- predict(restrict_var, n.ahead = 13, ci=.95)