Feeding ARIMA parameters to a subroutine

For questions regarding programming in the EViews programming language.

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

BrettT
Posts: 5
Joined: Tue Jan 22, 2013 12:20 pm

Feeding ARIMA parameters to a subroutine

Postby BrettT » Tue Jan 22, 2013 12:47 pm

Hi. I am writing a subroutine which involves estimating an ARIMA model, say mysubroutine. I would like it to be able to provide the ARIMA parameters when I call the subroutine, say mysubroutine(y,x,a,b,c). This routine would will take series x, parameters a, b and c as inputs and estimate ls d(x,a) c ar(1) ... ar(b) ma(1) ... ma(c), before eventually generating an output series y.

How should I write the codes for the ARIMA part in the subroutine? Thanks a lot.

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

Re: Feeding ARIMA parameters to a subroutine

Postby EViews Gareth » Tue Jan 22, 2013 12:52 pm

This program builds up an ARIMA string:
http://forums.eviews.com/viewtopic.php?f=15&t=1175

BrettT
Posts: 5
Joined: Tue Jan 22, 2013 12:20 pm

Re: Feeding ARIMA parameters to a subroutine

Postby BrettT » Tue Jan 22, 2013 1:51 pm

Thank you very much. I modified the codes and am now able to write my subroutine.

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

Re: Feeding ARIMA parameters to a subroutine

Postby EViews Gareth » Tue Jan 22, 2013 4:15 pm

I should point out that in EViews 8 you can simply do:

Code: Select all

ar(1 to {b}) ma(1 to {c})

BrettT
Posts: 5
Joined: Tue Jan 22, 2013 12:20 pm

Re: Feeding ARIMA parameters to a subroutine

Postby BrettT » Wed Jan 23, 2013 5:05 am

Thanks, it looks like I should ask my school to update the Eviews we have. BTW, when I embed the modified ARIMA codes into the subroutine and use the the subroutine in a loop, Eviews crushed in a few seconds. Then I reduce the amount of string variables (those "%*" variables) used in the ARIMA codes, it solves the problem, but running the loop is quite slow.
I should point out that in EViews 8 you can simply do:

Code: Select all

ar(1 to {b}) ma(1 to {c})


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests