Reputation: 21
When I use the var model in R packagevars
, I can use the function predict
to predict the model.
For example
z = VAR(x, p = 1, type = "const")
pred_y = predict(y, n = 1)
but when I use the SVAR
function, predict
throws an error
z = VAR(x, p = 1, type = "const")
y = SVAR(z,Amat = amat,Bmat = NULL)
predict(y)
Error in is.constant(y) :
(list) object cannot be coerced to type 'double'
How do I solve this problem?
Upvotes: 1
Views: 987
Reputation:
VAR, SVAR and SVEC Models: Implementation Within R Package vars : Bernhard Pfaff
See Section 3. Classes methods and functions
The methods "predict" for SVAR class doesn't exist. You can use instead the function "fevd" which show us how a shock impact the other variable
Upvotes: 1