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
ARMA and information criteria
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: ARMA and information criteria
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
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
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:
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?
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{%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
Code: Select all
%strp = %strp + "ar(" + @str(!i) + ")"
for !j = 1 to !maxq
%strq = %strq + "ma(" + @str(!j) + ")" -
fboehlandt
- Posts: 83
- Joined: Thu Apr 15, 2010 3:54 am
Re: ARMA and information criteria
An here it is:
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
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
nextminimum 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
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
!minp = 0
!minq = 0
Who is online
Users browsing this forum: No registered users and 2 guests
