why there are two var?

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

tinaliu
Posts: 3
Joined: Sat Sep 06, 2014 1:52 am

why there are two var?

Postby tinaliu » Sat Sep 06, 2014 2:07 am

I found a paper’s code about stgarch which formula is ht=ω+αut-1^2+δ1*G1*(ht-1)+β*ht-1+λ0d0
and the writer writes the code like this
....
var=@recode(d1=1,omega(2)/(1-alpha(2)),omega(2)+delata*@gammainc(var(-1),gamma+alpha(2)*res(-1)^2)
var=@recode(d1=1,0.05,du(1)*dummy+omga(2)+delta(1)*@gammainc(var(-1),gamma(1))+alpha(2)*res(-1)^2)
the calculate log likelihood by using var....
and I do not understand know why there are two var equation...

I just start to learn Eviews and my English is not good, hope you can understand me....
Thank you everyone first

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: why there are two var?

Postby EViews Gareth » Sat Sep 06, 2014 1:01 pm

Impossible to say without seeing the rest of the program.

tinaliu
Posts: 3
Joined: Sat Sep 06, 2014 1:52 am

Re: why there are two var?

Postby tinaliu » Sun Sep 07, 2014 2:45 am

Impossible to say without seeing the rest of the program.
formula is ht=ω+αut-1^2+δ1*G1*(ht-1)+β*ht-1+λ0d0

load return
series d1=0
smpl @first @first
d1=1
smpl @all
coef(1) mu(1)=0.0000309
coef(1) omega(1)=0.0075
coef(1) alpha(1)=0.05
coef(1) gamma(1)=0.00755
coef(1) du(1)=0.0123
coef(1) delta(1)=0.73
coef(1) tdf(1)=2.065
logl stgarcht
stgarcht.append @logl logl
stgarcht.append res=return-mu(2)
@LOGl LOGl
RES=RETURN-mu(2)
stgarcht.append
var=@recode(d1=1,omega(2)/(1-alpha(2)),omega(2)+delata*@gammainc(var(-1),gamma+alpha(2)*res(-1)^2)
stgarcht.append
var=@recode(d1=1,0.05,du(1)*dummy+omga(2)+delta(1)*@gammainc(var(-1),gamma(1))+alpha(2)*res(-1)^2)
stgarch.append z=res^2/var/(tdf(1)-2)+1
stgarcht.appendd logl=@gammalog((tdf(1)+1)/2)-@gammalog(tdf(1)/2)-log(3.14159265359)/2-log(var)/2-log(tdf(1)-2)/2-log(var)/2-(tdf(1)+1)*log(z)/2
stgarcht.ml(showopts,m=50,c=1e-5)



That is the code.And I also do not know why there is a gamma in the first var instead of the gamma(1), is it a print error or something I do not know?
Thank you very much for replying, and my English is very poor, hope you could understand me...
Thank you again.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests