38 estimations and forecasts

For questions regarding programming in the EViews programming language.

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

suraya
Posts: 1
Joined: Tue Nov 19, 2013 8:41 am

38 estimations and forecasts

Postby suraya » Wed Nov 20, 2013 4:52 am

Hi There,

I have 38 pairwise estimations and I want to run forecasts for each. My end point is to create a coefficient mean from the 38 estimations . I am looking for the command code to pick up the last observation from each X so I can produce an one step ahead forecast. The start and end of each X is different so there is no point in setting a date as I am only looking for one step ahead forecast.

One more quick question I will also want to generate out of sample for all the 38 estimations, any tips to do this efficiently when you have 38 estimations and 38 forecasts... I would need coefficients, and evaluation stats so I have the RMSE

My short program (I am using eviews 8) looks like

wfopen eviews_log

'create 38 X series
for !i=1 to 38
next

'run pairwise regressions between Y and each X
for !i=1 to 38
equation eq{!i}.ls y1 c d(y1)-1 d(x{!i})-1
next

'forecast
for !i=1 to 38
'smpl 7/01/2013 07/01/2013 this is where I need help
eq{!i}.forecast y1f{!i}
next

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

Re: 38 estimations and forecasts

Postby EViews Gareth » Wed Nov 20, 2013 9:19 am

You're best off using the same loop to do the estimation and the forecast (i.e. forecast from each equation immediately, rather than estimating all equations, then forecasting all equations. Then you can use the resid series to tell you which observations were in the estimation and which weren't.
Something like:

Code: Select all

for !i=1 to 38 smpl @all equation eq{!i}.ls y1 c d(y1)-1 d(x{!i})-1 %last = resid.@last smpl {%last}+1 {%last}+2 eq{!i}.forecast y1f{!i} next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest