Page 1 of 1

Specifying a solution sample in Model within Program

Posted: Wed Aug 04, 2010 12:49 pm
by otb
I had a question about specifying a forecast sample (from a VAR-Model) in an EViews program:

I make the program run recursive VARs (with increasing sample size) and save them in separate files identified by the counters. I then turn each of these VARs into a Model using makemodel. Now I want to make out-of-sample forecasts from each model with the initial forecast point to start right after the estimation end-point.

I couldn't figure out how to do this within the loop. I tried to change the sample within the loop before using the .solve command, but still the program solves the model using the estimation sample. Is there a way around this?

Thanks for the help.

Re: Specifying a solution sample in Model within Program

Posted: Wed Aug 04, 2010 1:15 pm
by EViews Gareth
Sounds like you're doing the correct thing - setting the workfile sample, using a smpl statement, prior to issuing the solve command.

Re: Specifying a solution sample in Model within Program

Posted: Wed Aug 04, 2010 1:51 pm
by otb
ok, I guess the problem is the program is not saving the solution after each iteration; I only get the last in variables named _0 after each variable. How can I store the solutions in each iteration with a different name after a solve command in the loop?

Re: Specifying a solution sample in Model within Program

Posted: Wed Aug 04, 2010 1:53 pm
by EViews Gareth
Well an easy way would just be to create a new variable equal to the model solution each time. If your loop counter is !i, and the series you're solving for is Y (to give a solution series called Y_0), then just do this inside the loop:

Code: Select all

series y_0_{!i} = y_0

Re: Specifying a solution sample in Model within Program

Posted: Wed Aug 04, 2010 2:06 pm
by otb
that does it. thanks.