How to run large number of estimations and save output?

For questions regarding programming in the EViews programming language.

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

franz82
Posts: 7
Joined: Thu May 19, 2011 9:32 am

How to run large number of estimations and save output?

Postby franz82 » Thu May 19, 2011 10:19 am

Hi,

I have a large number of estimations (160) to run, is there a better way to do this than by Quick>Estimate Equation 160 times?

I want to estimate an ardl equation with the following look:
d(gnuk) c time d(gnuk(-1)) d(gnuk(-2)) d(yuk(-1)) d(yuk(-2)) d(bxuk(-1)) d(bxuk(-2)) d(op(-1)) d(op(-2)) gnuk(-1) yuk(-1) bxuk(-1) op(-1)

Help would very much indeed be appreciated!

Thanks
Franz
Using Eviews 5

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: How to run large number of estimations and save output?

Postby startz » Thu May 19, 2011 11:03 am

You may be able to write a loop in a program (.prg file). But the easiest thing may be to create a program file, do copy-and-paste a lot, and then edit the individual specifications.

franz82
Posts: 7
Joined: Thu May 19, 2011 9:32 am

Re: How to run large number of estimations and save output?

Postby franz82 » Thu May 19, 2011 11:28 am

Thanks, but how can I then save the output from each equation?

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

Re: How to run large number of estimations and save output?

Postby EViews Gareth » Thu May 19, 2011 11:36 am


franz82
Posts: 7
Joined: Thu May 19, 2011 9:32 am

Re: How to run large number of estimations and save output?

Postby franz82 » Thu May 19, 2011 4:21 pm

Thank you startz and Gareth,

I have been reading the suggested material and I am almost there. The problem is that my dependent series are product groups coded _001 up to _999. There are only 160 series but still with varying codes in that range. When I run the program in it`s "simulated" environment it works perfectly but as soon as I remove some series it stops. In the real sample this is the problem, there are not all series up to _999. Could the program be rewritten to focus on text instead of numbers like _345? Would that solve the problem?

The program is written to give you as much details on my confuguration as possible.

------------------------------------------------------------
'create a workfile
wfcreate a 1962 2009

'create a yse series
series yse=nrnd

'create a yde series
series yde=nrnd

'create a rebex series
series rebex=nrnd

'create 1 special X series
series _002=nrnd

'create 999 X series
for !i=001 to 999
series _{!i}=nrnd
next

'run regressions between the different X:s an the three other "constant" series yse yde and rebex
for !i=001 to 999
equation eq{!i}.ls d(_{!i}) c d(_{!i}(-1)) d(_{!i}(-2)) d(yse(-1)) d(yse(-2)) d(yde(-1)) d(yde(-2)) d(rebex(-1)) d(rebex(-2)) _{!i}(-1) yse(-1) yde(-1) rebex(-1)
next


-------------------------------------------

I would be very happy indeed over a hint on solving this.

Thank you very much!
Franz
Eviews 5. 0

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

Re: How to run large number of estimations and save output?

Postby EViews Gareth » Thu May 19, 2011 6:12 pm


franz82
Posts: 7
Joined: Thu May 19, 2011 9:32 am

Re: How to run large number of estimations and save output?

Postby franz82 » Fri May 20, 2011 6:46 am

Solved the problem by renamning series to p1-p160, since i don´t understand the string option works.

Thank you! :D

New question:
In the automatic lag selector programme in the guide you directed me to, how would one modify it to run different (other) dependent variables (numeric) on a constant set of explanatory variables?

Since in the program the FOR is already occupied by the maxlags I cant use a new FOR in this section, how could this be solved?
--------------------------------------
for !i=1 to !maxlags
eq.ls y c y(-1 to -!i) 'run regression of Y on a constant and lagged values of itself up to the iTH lag.
if eq.@aic < !aic then
!bestlag = !i 'if this lag specification has the best AIC, then store this lag as !bestlag.
!aic = eq.@aic
endif
next
-----------------------------

Best regards
Franz


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests