ARMA Program

For questions regarding programming in the EViews programming language.

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

brennan6738
Posts: 31
Joined: Tue Sep 08, 2009 1:28 pm

ARMA Program

Postby brennan6738 » Mon Jan 04, 2010 8:24 pm

Does anyone know if there is a way to set the sample size within a program? I have a program set up that calculates the AIC and SIC for various ARMA models, but I believe I need to shorten the sample (from the start) so that the AIC and SIC will be comparable with the degrees of freedom. My program is below. Any suggestions would be great:

equation arma55.ls creditx c ar(1) ar(2) ar(3) ar(4) ar(5) ma(1) ma(2) ma(3) ma(4) ma(5)

equation arma54.ls creditx c ar(1) ar(2) ar(3) ar(4) ar(5) ma(1) ma(2) ma(3) ma(4)

equation arma53.ls creditx c ar(1) ar(2) ar(3) ar(4) ar(5) ma(1) ma(2) ma(3)

equation arma52.ls creditx c ar(1) ar(2) ar(3) ar(4) ar(5) ma(1) ma(2)

equation arma51.ls creditx c ar(1) ar(2) ar(3) ar(4) ar(5) ma(1)

equation arma50.ls creditx c ar(1) ar(2) ar(3) ar(4) ar(5)

equation arma45.ls creditx c ar(1) ar(2) ar(3) ar(4) ma(1) ma(2) ma(3) ma(4) ma(5)

equation arma44.ls creditx c ar(1) ar(2) ar(3) ar(4) ma(1) ma(2) ma(3) ma(4)

equation arma43.ls creditx c ar(1) ar(2) ar(3) ar(4) ma(1) ma(2) ma(3)

equation arma42.ls creditx c ar(1) ar(2) ar(3) ar(4) ma(1) ma(2)

equation arma41.ls creditx c ar(1) ar(2) ar(3) ar(4) ma(1)

equation arma40.ls creditx c ar(1) ar(2) ar(3) ar(4)

equation arma35.ls creditx c ar(1) ar(2) ar(3) ma(1) ma(2) ma(3) ma(4) ma(5)

equation arma34.ls creditx c ar(1) ar(2) ar(3) ma(1) ma(2) ma(3) ma(4)

equation arma33.ls creditx c ar(1) ar(2) ar(3) ma(1) ma(2) ma(3)

equation arma32.ls creditx c ar(1) ar(2) ar(3) ma(1) ma(2)

equation arma31.ls creditx c ar(1) ar(2) ar(3) ma(1)

equation arma30.ls creditx c ar(1) ar(2) ar(3)

equation arma25.ls creditx c ar(1) ar(2) ma(1) ma(2) ma(3) ma(4) ma(5)

equation arma24.ls creditx c ar(1) ar(2) ma(1) ma(2) ma(3) ma(4)

equation arma23.ls creditx c ar(1) ar(2) ma(1) ma(2) ma(3)

equation arma22.ls creditx c ar(1) ar(2) ma(1) ma(2)

equation arma21.ls creditx c ar(1) ar(2) ma(1)

equation arma20.ls creditx c ar(1) ar(2)

equation arma15.ls creditx c ar(1) ma(1) ma(2) ma(3) ma(4) ma(5)

equation arma14.ls creditx c ar(1) ma(1) ma(2) ma(3) ma(4)

equation arma13.ls creditx c ar(1) ma(1) ma(2) ma(3)

equation arma12.ls creditx c ar(1) ma(1) ma(2)

equation arma11.ls creditx c ar(1) ma(1)

equation arma10.ls creditx c ar(1)

equation arma01.ls creditx c ma(1)

arma55.@aic arma55.@sc arma54.@aic arma54.@sc arma53.@aic arma53.@sc arma52.@aic arma52.@sc arma51.@aic arma51.@sc arma50.@aic arma50.@sc arma44.@aic arma44.@sc arma43.@aic arma43.@sc arma42.@aic arma42.@sc arma41.@aic arma41.@sc arma40.@aic arma40.@sc arma33.@aic arma33.@sc arma32.@aic arma32.@sc arma31.@aic arma31.@sc arma30.@aic arma30.@sc arma22.@aic arma22.@sc arma21.@aic arma21.@sc arma20.@aic arma20.@sc arma11.@aic arma11.@sc arma10.@aic arma10.@sc arma01.@aic arma01.@sc

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

Re: ARMA Program

Postby EViews Gareth » Tue Jan 05, 2010 9:57 am

You can use the smpl command to change the sample.

You might like to search the forum for other examples of people doing similar things to you.

fmgoto
Posts: 76
Joined: Thu Jan 15, 2009 5:01 am
Location: Brasilia, Brazil

Re: ARMA Program

Postby fmgoto » Mon Feb 01, 2010 6:49 am

Not smart, but it works!

for !p = 1 to !p_max
for !q = 1 to !q_max

if !p = 1 then
%ar = "ar(1)"
else
%ar = %ar + "ar(" + @str(!p) + ")"
endif

if !q = 1 then
%ma = "ma(1)"
else
%ma = %ma + "ma(" + @str(!q) + ")"
endif

equation eq_ar{!p}_ma{!q}.ls y {%ar} {%ma}

!counter = !counter + 1
next
next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests