ARMA and information criteria

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

ARMA and information criteria

Postby fboehlandt » Tue Feb 19, 2013 9:24 am

Hi everyone,
is there a way to produce the information criteria for several ARMA(p,q) models in one go, for example, a tabular display of AIC for p = 0 to 3 and q = 0 to 3, or do I have to run the equations manually?
Regards
Florian

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

Re: ARMA and information criteria

Postby EViews Gareth » Tue Feb 19, 2013 9:37 am

You'll have to write a program that does it.

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: ARMA and information criteria

Postby fboehlandt » Tue Feb 19, 2013 9:48 am

I thought as much. Should not be difficult, I'll post back once I have it

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: ARMA and information criteria

Postby fboehlandt » Wed Feb 20, 2013 6:01 am

Hi Gareth,
I have come across a little snag. Assume I would like to test all models from ARMA(1,1) to ARMA(5,5). Obviously, I need one loop for p and another for q (ARMA(p,q)). Within the loops lies the equation, for example:

Code: Select all

for !i = 1 to !maxp for !j = 1 to !maxq equation e1.ls(n) {%n} c ar(!i) ma(!j) next next
That should give me all models:
{%n} c ar(1) ma(1)
{%n} c ar(2) ma(1)
{%n} c ar(3) ma(1)
...
{%n} c ar(5) ma(5)

unfortunately, except the first one, that is not what I am looking for. Rather, the models should be:
{%n} c ar(1) ma(1)
{%n} c ar(1) ar(2) ma(1)
{%n} c ar(1) ar(2) ar(3) ma(1)
...
{%n} c ar(1) ar(2) ar(3) ar(4) ar(5) ma(1) ma(2) ma(3) ma(4) ma(5)

There appears to be no shorthand to enter this. I was thinking to perhaps assign a vector of sorts to contain the current regressors, but I am not sure how to do this. Could you perhaps assist? Is there an easier way of doing this?

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: ARMA and information criteria

Postby fboehlandt » Wed Feb 20, 2013 6:15 am

Code: Select all

%strp = %strp + "ar(" + @str(!i) + ")" for !j = 1 to !maxq %strq = %strq + "ma(" + @str(!j) + ")"
Working with expanding strings seems to work. I will post back with results

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: ARMA and information criteria

Postby fboehlandt » Wed Feb 20, 2013 6:44 am

An here it is:

Code: Select all

'arma aic hqic sbic 'Florian Böhlandt, 2012/07/17 'www.usb.co.za !minp = 1 !minq = 1 !maxp = 5 !maxq = 5 %group = "group01" !n = {%group}.@count for !i = 1 to !n %n = {%group}.@seriesname(!i) 'prep output tables table(!maxp + 1, !maxq + 1) table01 table(!maxp + 1, !maxq + 1) table02 table(!maxp + 1, !maxq + 1) table03 %str1 = %n+"_aic" %str2 = %n+"_hqic" %str3 = %n+"_sbic" rename table01 {%str1} rename table02 {%str2} rename table03 {%str3} {%str1}(1,1) = "p/q" {%str2}(1,1) = "p/q" {%str3}(1,1) = "p/q" 'loop for p and q %strp = "" for !ii = !minp to !maxp {%str1}(!ii + 2,1) = !ii {%str2}(!ii + 2,1) = !ii {%str3}(!ii + 2,1) = !ii 'create string ar(p) if !ii = 0 then %strp = "" else %strp = %strp + "ar(" + @str(!ii) + ")" endif %strq = "" for !j = !minq to !maxq {%str1}(1,2 + !j) = !j {%str2}(1,2 + !j) = !j {%str3}(1,2 + !j) = !j 'create string ma(q) if !j = 0 then %strq = "" else %strq = %strq + "ma(" + @str(!j) + ")" endif equation e1.ls(n) {%n} c {%strp} {%strq} {%str1}(2 + !ii,2 + !j) = e1.@aic {%str2}(2 + !ii,2 + !j) = e1.@hq {%str3}(2 + !ii,2 + !j) = e1.@schwarz next next next
To enter:
minimum and maximum p (!mip anf !maxp)
minimum and maximum q (!minq and !maxq)

The routine works for single series or series grouped in "group01" (outer loop). The created tables retain the series name and appendices "_aic" (Akaike), "_hqic" (Hannan-Quinn) and "_sbic" (Schwarz). Hope this helps others. If not in the right section , please feel free to move this thread.

Regards

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: ARMA and information criteria

Postby fboehlandt » Wed Feb 20, 2013 8:20 am

p.s. to produce pure AR[p] or MA[q] or models where AR[0] and MA[0] (intercept only) set:
!minp = 0
!minq = 0


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests