Page 1 of 1

ARMA and information criteria

Posted: Tue Feb 19, 2013 9:24 am
by fboehlandt
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

Re: ARMA and information criteria

Posted: Tue Feb 19, 2013 9:37 am
by EViews Gareth
You'll have to write a program that does it.

Re: ARMA and information criteria

Posted: Tue Feb 19, 2013 9:48 am
by fboehlandt
I thought as much. Should not be difficult, I'll post back once I have it

Re: ARMA and information criteria

Posted: Wed Feb 20, 2013 6:01 am
by fboehlandt
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?

Re: ARMA and information criteria

Posted: Wed Feb 20, 2013 6:15 am
by fboehlandt

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

Re: ARMA and information criteria

Posted: Wed Feb 20, 2013 6:44 am
by fboehlandt
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

Re: ARMA and information criteria

Posted: Wed Feb 20, 2013 8:20 am
by fboehlandt
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