On Thu, 7 Jun 2007, Chris wrote:
Hi,
Your script is confusing me a bit;)
so if I had an arch process that was arch 24 and arima 1 1 would I change
the script to this:
I'm reaaly on the run, but a few quick comments:
function filter(series y, \
scalar arpar, scalar mapar, \
scalar om, scalar alpha1, scalar alpha2, \
scalar alpha3, scalar alpha4, scalar alpha5, \
scalar alpha6, scalar alpha7, scalar alpha8, \
scalar alpha9, scalar alpha10, scalar alpha11, \
scalar alpha12, scalar alpha13, scalar alpha14, \
scalar alpha15, scalar alpha16, scalar alpha17, \
scalar alpha18, scalar alpha19, scalar alpha20, \
scalar alpha21, scalar alpha22, scalar alpha23, \
scalar alpha24, \
series *e, series *h)
Believe me, you *want* to use a vector here; besides, why don't you
collapse such a long arch part to a nice garch part?
scalar err = 0
scalar T = $nobs
series e = 0
series h =
om/(1-alpha1-alpha2-alpha3-alpha4-alpha5-alpha6-alpha7-alpha8-alpha9-alpha10-alpha11-alpha12-alpha13-alpha14-alpha15-alpha16-alpha17-alpha18-alpha19-alpha20-alpha21-alpha22-alpha23-alpha24)
Again, use a vector. And be sure to check for \sum \alpha_i < 1.
loop for i=2..T --quiet
scalar e2lag = e[i-1]^2
scalar e3lag = e[i-2]^2
...
well, in this case the loop shouldn't start from 2, should it? In your
case, you ought to start from 25 (when i==2, i-2 is, well, zero)
When I run this I get the error "Bad character 'i' in
date string" and the
script halts.
see above
Also, the script only appears to output the estimated alphas
and arima coefficients. How would I modify this to get a more garch like
output with coefficients estimated for the function total = B1 + B2*X2 +
B3*X3? i.e how do I get it to estimate the B's as well?
Sorry? I don't quite understand what you mean here.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti