Solve loop in model

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

bsg9
Posts: 6
Joined: Wed Aug 12, 2015 6:34 am

Solve loop in model

Postby bsg9 » Thu Dec 17, 2015 2:01 am

Hi,

I am using Eviews 8.

I try to make a loop in which I create several models that differ in their estimation and forecast samples.
It looks like :

Code: Select all

for !i = 0 to 12
smpl 2000Q1 2010Q4+!i (estimation sample)
model modelname{!i}

(...)

smpl 2011Q1+!i 2011Q4+!i (forecast sample)

modelname{!i}.append ....
modelname{!i}.merge ....

solve(d=s, s=a) modelname{!i}

next


My problem is that Eviews only stores the results of each model "modelname" for the last forecast sample (in the example 2014Q1 2014Q4). Whereas I want to have modelname1 solved only for 2011Q2 2012Q1; modelname2 solved for 2011Q3 2012Q2, etc.
Do you know what is the problem ? How can I force Eviews to store my results each time ?

Thank you very much

bsg9
Posts: 6
Joined: Wed Aug 12, 2015 6:34 am

Re: Solve loop in model

Postby bsg9 » Thu Dec 17, 2015 7:11 am

I have tried several things and I have noticed that Eviews erases each time the baseline solution (the variable in _0) with the new one. That is why at the end of the loop I get only the solution with the last sample.

But is there a way to give other aliases to the baseline solution ? Or at least to store anyhow different baseline solutions for different models in a same workfile ? How can I do it please ?

I have tried to create several scenarios at each iteration but Eviews does not seem to accept that only the sample varies from one scenario tothe other (I think he wants me to shock a variable).

If you have an idea, it would be of great help.

Thank you again.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: Solve loop in model

Postby EViews Gareth » Thu Dec 17, 2015 10:40 am

Scenarios cannot have different samples - Scenarios don't have samples at all.

You cannot change the baseline alias.

Perhaps the best thing to do is simply copy the results of each solve into a new series each time.
Follow us on Twitter @IHSEViews


Return to “Models”

Who is online

Users browsing this forum: No registered users and 11 guests