Page 1 of 1

Estimation of Egach model

Posted: Wed Apr 29, 2009 4:35 am
by saloua
hi all,
i'm student, and it's the firts time that y will use eviews. :shock:
i have a problem with the estimation of ngarch model, so please any help or response to my question is a big pleasure to me
i have a serie of the S&P500 return, i have to estimate using the model bolow, the garch model with everage effect (precisely with the ngarch model)
Rt= µ +ϭt*zt
ϭt+1= ω+α*(R(t-1) - ϴ*ϭ(t-1))^2+β*ϭ^2(t-1)

but whith eviews, the ngarch model is not availible, so i have to programme it. i don't have any idea how to do it :cry:

thinks in advance for your help, i rearly need it.

Re: Estimation of Egach model

Posted: Wed Apr 29, 2009 5:03 am
by saloua
sorry i made a mistake on the title of the object, it's about de the estimation of the ngarch model and not the egrach.
thxs in advance

Re: Estimation of Egach model

Posted: Wed Apr 29, 2009 9:33 am
by saloua
no body have any idea about the estmation of the ngarch with eviews :cry:

Re: Estimation of Egach model

Posted: Thu Apr 30, 2009 1:41 pm
by trubador
Try the following piece of code. Just copy and paste it into a new programming window and run it. Estimation of such models is not an easy task. You may encounter some difficulties during the estimation arising from either the data properties or the specification of the likelihood. You can change/modify the code freely to overcome such issues.

Code: Select all

' declare coefficient vectors coef(1) mu coef(1) omega coef(1) alpha coef(1) theta coef(1) beta ' get starting values from a regular GARCH model '(absolute values are to ensure the nonnegativity of cond. variance process) equation start.arch(m=100,c=1e-6) r c mu(1) = start.@coefs(1) omega(1) = @abs(start.@coefs(2)) alpha(1) = @abs(start.@coefs(3)) beta(1) = @abs(start.@coefs(4)) theta(1) = @sqrt(((1-beta(1))/alpha(1))-1) ' set presample values of expressions in logl smpl @first @first series sigt = omega(1) ' set up NGARCH likelihood logl ngarch ngarch.append @logl logl ngarch.append res = r-mu(1) ngarch.append sigt = omega(1) + alpha(1)*(r(-1) - theta(1)*@sqrt(sigt(-1)))^2 + beta(1)*sigt(-1) ngarch.append logl = log(@dnorm(res/@sqrt(sigt))) - log(sigt)/2 ' estimate and display results smpl @first+1 @last ngarch.ml(showopts, m=1000, c=1e-6) show ngarch.output smpl @all

Re: Estimation of Egach model

Posted: Thu Apr 30, 2009 5:23 pm
by saloua
thx a lot,
your code works with my data, i just changed two specification about the sample,

thank you again and again :)
saloua