solve model with scenario

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

vytama
Posts: 72
Joined: Wed Dec 19, 2012 11:05 am

solve model with scenario

Postby vytama » Wed Feb 01, 2023 2:06 pm

Hello,

I am trying to solve the model for scenario 2 where I shock oil price in log terms in Q2 of 2020.
Here is the script for it:

'Oil Shock
series global_oil_cyc_2m = global_oil_cyc_0m
smpl 2020q2 2020q2
series global_oil_cyc_2m = global_oil_cyc_0m+0.5
smpl @all
m_var.scenario(a="_2") "Oil Shock"
m_var.override global_oil_cyc("2020q2 2020q2")
m_var.exclude global_oil_cyc("2020q2 2020q2")
smpl 2020q2 2024q4
m_var.solve

it might a stupid question as I question the output.
After the model is solved, the Q2 (overridden value) in global_oil_cyc_2m series reverts to actual value. Is this how it is supposed to be?
Also, if I replace the shock from positive 0.5 to negative 0.5, I get very similar results. I'd expect somewhat opposite outcome. Am I missing something here? Thank you, Vytas

EViews Matt
EViews Developer
Posts: 557
Joined: Thu Apr 25, 2013 7:48 pm

Re: solve model with scenario

Postby EViews Matt » Fri Feb 03, 2023 2:31 pm

Hello,

There is an issue. When performing a stochastic solve, it appears that overrides may be ignored depending on the solution options (including the defaults, unfortunately). We should have a fix for this behavior ready for the next EViews patch.

FYI, there's no need to specify a sample range as part of the Model::override procedure. A variable's override status is a binary flag (on or off). For an endogenous variable, a sample range supplied to Model::exclude controls which observations are overridden.

vytama
Posts: 72
Joined: Wed Dec 19, 2012 11:05 am

Re: solve model with scenario

Postby vytama » Mon Mar 20, 2023 9:46 am

Thank you EViews Matt. A follow up question - I'd like to have an additional shock (2 shocked variables (policy rates in the example below) at the same time):

series d_pol_eu_6m = d_pol_eu_0m
series d_pol_us_6m = d_pol_us_0m

smpl 2020q1 2020q1

series d_pol_eu_6m = d_pol_eu_0m+0.01
series d_pol_us_6m = d_pol_us_0m+0.01

smpl @all
m_gvar.scenario( a="_6") "EU & US Rate Shock"

m_gvar.override d_pol_eu'
m_gvar.override d_pol_us

m_gvar.exclude d_pol_eu
m_gvar.exclude d_pol_us

smpl 2020q1 2024q4
m_gvar.solve

In this example EViews shocks only the second variable and does not shock the first one. How can I change the code in order both shocks would be applied?

Thanks,

Vytas


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 19 guests