Please bare in mind that I'm extremely novice.
Many thanks.
Moderators: EViews Gareth, EViews Moderator
Code: Select all
' Create a sample VAR(2) with 2 exogenous variables
create u 100
series x = rnd
series y = nrnd
series z = rnd
series j = rnd
series k = rnd
var v.ls 1 2 x y z @ j k
' Create a model object from the VAR
v.makemodel(m)
' Switch to a model scenario where we can specify overrides
m.scenario "scenario 1"
' Create new series for the VAR that are all zeros.
series x_1 = 0
series y_1 = 0
series z_1 = 0
series j_1 = 0
j_1(3) = 1 ' This is our shock
series k_1 = 0
' Force the model to use the *_1 series instead of the original series.
m.override x y z j k
m.exclude x("1 2") y("1 2") z("1 2")
' Solve the model, effectively performing a forecast
m.solve
' Results for our endogenous variables are in x_1, y_1, and z_1. View them.
group g x_1 y_1 z_1
g.line(m)
Code: Select all
' Create a sample VAR(2) with 2 exogenous variables
create a 2000 2020 3
series x = rnd
series y = nrnd
series z = rnd
series j = rnd
series k = rnd
var v.ls 1 2 x y z @ j k
' Create a model object from the VAR
v.makemodel(m)
' Switch to a model scenario where we can specify overrides
m.scenario "scenario 1"
' Create new series for the VAR that are all zeros.
series x_1 = 0
series y_1 = 0
series z_1 = 0
series j_1 = 0
j_1(v.@lagorder + 1) = 1 ' This is our shock
series k_1 = 0
' Force the model to use the *_1 series instead of the original series.
m.override x y z j k
%ex_range = @otod(1) + " " + @otod(v.@lagorder)
m.exclude x(%ex_range) y(%ex_range) z(%ex_range)
' Solve the model, effectively performing a forecast
m.solve
' Results for our endogenous variables are in x_1, y_1, and z_1. View them.
group g x_1 y_1 z_1
g.line(m)
Users browsing this forum: No registered users and 2 guests