Page 1 of 1

Different expressions for same endogenous using scenarios

Posted: Thu Jul 13, 2017 12:17 pm
by guidoianni
Hi all!

First of all, some general background:
I am building a model for simulation purposes in Eviews. The model is 100% theoretical in nature (it has not any observed data, it's all simulated within the model) and i'm trying to consider two different 'clousures' for the model. I have a "general" model and i'm using two scenarios, one for each clousure. In each scenario I have different expressions for the same endogenous variable.
Now, my specific question:
While I can specify the different expression for each scenario using the "modelname.drop & modelname.append" commands every time I have to switch from one scenario to the other, it would be great to have each scenario with it's specific equations stored, so I do not have to manually change them. I initially thought that the "modelname.override" command might do the trick, but the problem is that, depending on the clousure, i have the SAME endogenous in BOTH scenarios, but the equation that determine this endogenous is DIFERENT in each one. The ".override" doesn't work because the expression contains endogenous so I cannot build a "_alias" in the workfile prior to solving the model. ¿Has anyone know how to deal with this issue?

PS: The "drop+append" does the trick for the time being, but as it is a problem that I have with more than one variable it makes the program increasingly difficult to read.

Re: Different expressions for same endogenous using scenarios

Posted: Thu Jul 13, 2017 1:07 pm
by EViews Gareth
There isn't a built in way to do it, but you could play a trick.

Say you want in Scenario 1, this expression:

Code: Select all

y=0.2+0.4*x(-1)

and in Scenario 2, this:

Code: Select all

y=-0.5+0.2*z


Then, create the following series in your workfile:

Code: Select all

series ind=0
series ind_1=0
series ind_2=1


Then specify Y in your model as:

Code: Select all

y=@recode(ind=1, -0.5+0.2*z, 0.2+0.4*x(-1))

which will switch the specification of Y depending on the value of the series "ind".

Now in each scenario overwrite the ind series so that Scenario 1 uses the values of Ind in "ind_1" and Scenario 2 uses "ind_2".


I haven't tried it, but it seems like this should work.

Re: Different expressions for same endogenous using scenarios

Posted: Thu Jul 13, 2017 2:19 pm
by guidoianni
Thank you very much!!

I can't believe i didn't tried this "dummy" approach before!

Re: Different expressions for same endogenous using scenarios

Posted: Fri Nov 10, 2017 2:59 am
by jlbrillet
Another way of doing it is using a scalar parameter:

scalar p=1
model1.append x=(p=1)*f1+(p=2)*f2

Beware that you have to "update" the model after changing the value.

If you do not want to do this you should define the parameter as a series

generate p=1
model1.append x=(p=1)*f1+(p=2)*f2