Simple MA Loop

For questions regarding programming in the EViews programming language.

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

blue2011
Posts: 18
Joined: Sat Mar 26, 2011 3:16 pm

Simple MA Loop

Postby blue2011 » Tue Jul 19, 2011 11:46 pm

Dear Eviews User

I have a simple question regarding the following problem. I have been staring at it for so long, but could not figure it out yet.

for !j=2 to 24
ar_ma{!j}.ls cinf c AR(1) MA(1) MA(!j)
ar_ma{!j}.makeresids arma{!j}
next

With the code above, I would like to first estimate ARMA(1,(1,2)), later ARMA (1,(1,3)).....ARMA(1,(1,24)), but it kept giving me errors. I would appreciate your help with this estimation.

Thanks!

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

Re: Simple MA Loop

Postby EViews Gareth » Wed Jul 20, 2011 7:59 am

Obviously we can't tell without seeing the whole program, but are you declaring the equation objects anywhere?

Otherwise, you'd have to modify your code to be:

Code: Select all

for !j=2 to 24 equation ar_ma{!j}.ls cinf c AR(1) MA(1) MA(!j) ar_ma{!j}.makeresids arma{!j} next

blue2011
Posts: 18
Joined: Sat Mar 26, 2011 3:16 pm

Re: Simple MA Loop

Postby blue2011 » Thu Jul 21, 2011 5:54 am

Thanks Gareth. You are great! It works fine now.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests