On Mon, 26 Sep 2011, Jeevan Tambuluri wrote:
Now, has anyone tried this using GRETL where multiple models are
tried
and results (fstats output) are compared to pick one over the other? If
so is there a GRETL script out there that can be shared?
The following simple script does something which I think is close to what
you want, the main difference being that it uses the BIC instead of a
forecast-based fit measure. Of course, it's pretty rought, but refining it
to your needs should be relatively easy.
<hansl>
set echo off
set messages off
open np.gdt
y = ldiff(gnpdefl)
scalar bestsofar = NA
scalar bestp = NA
scalar bestq = NA
scalar maxp = 3
scalar maxq = 3
loop i=0..maxp --quiet
loop j=0..maxq --quiet
arima i 0 j ; y --quiet
c = $bic
printf "Arma(%2d,%2d) : %g\n", i, j, c
if (c<bestsofar) || missing(bestsofar)
bestsofar = c
bestp = i
bestq = j
endif
endloop
endloop
arima bestp 0 bestq ; y
</hansl>
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti