Hello,
Im trying to understand how Logl object works and how to use it properly.
So i decided to start with something that Eviews can do automaticaly, like normal GARCH(1,1) model. I estimated both normal GARCH(1,1) with standard estimation settings and Logl that looks just like this:
@LOGL LOGL1
RES = X - C(1)
VAR = C(2)+C(3)*(RES(-1)^2)+C(4)*VAR(-1)
LOGL1 = -(1/2)*log(VAR)-(1/2)*log(2*3.1416926)-((RES)^2)/VAR
I added first VAR number by hand. And it equals unconditional variance.
It seems that these two prosidures give me different results. C(2) and C(3) are 2 times greater then in a stardard procidure. Please help me, how can I get exactly the same result in Logl? Thank you!
Logl object
Moderators: EViews Gareth, EViews Moderator
Re: Logl object
And one more question.
Does Logl object support loglikelihood with @iff function in it? Im trying to estimate Scewed-t distribution GARCH(1,1) with the following code:
@Logl skewt
RES = x - C(1)
VAR = C(2) + C(3)*((RES(-1))^2) + C(4)*VAR(-1)
ce = (@gamma((C(6)+1)/2))/((@sqrt(3.1416926*(C(6)-2)))*(@gamma(C(6)/2)))
lnce = @gammalog((C(6)+1)/2) - log(3.1415926*(C(6)-2))/2 - @gammalog(C(6)/2)
a = 4*C(5)*ce*(C(6)-2)/(c(6)-1)
b = @sqrt(1 + 3*((C(5))^2) - a^2)
lnb = (1 + 3*((C(5))^2) - a^2)/2
skewt = @iff((RES/@sqrt(VAR)) < -(a/b),lnb + lnce - ((C(6)+1)/2)*(log(1 + (1/(C(6)-2))*(((b*(RES/@sqrt(VAR)) +a)/(1 - C(5)))^2))),lnb + lnce - ((C(6)+1)/2)*(log(1 + (1/(C(6)-2))*(((b*RES +a)/(1 + C(5)))^2))))
As you can see there is an IF function in loglikelihood; Eviews tells me "SKEWT already exists and is of a wrong type". Does @iff cause this problem? Thank you!
Does Logl object support loglikelihood with @iff function in it? Im trying to estimate Scewed-t distribution GARCH(1,1) with the following code:
@Logl skewt
RES = x - C(1)
VAR = C(2) + C(3)*((RES(-1))^2) + C(4)*VAR(-1)
ce = (@gamma((C(6)+1)/2))/((@sqrt(3.1416926*(C(6)-2)))*(@gamma(C(6)/2)))
lnce = @gammalog((C(6)+1)/2) - log(3.1415926*(C(6)-2))/2 - @gammalog(C(6)/2)
a = 4*C(5)*ce*(C(6)-2)/(c(6)-1)
b = @sqrt(1 + 3*((C(5))^2) - a^2)
lnb = (1 + 3*((C(5))^2) - a^2)/2
skewt = @iff((RES/@sqrt(VAR)) < -(a/b),lnb + lnce - ((C(6)+1)/2)*(log(1 + (1/(C(6)-2))*(((b*(RES/@sqrt(VAR)) +a)/(1 - C(5)))^2))),lnb + lnce - ((C(6)+1)/2)*(log(1 + (1/(C(6)-2))*(((b*RES +a)/(1 + C(5)))^2))))
As you can see there is an IF function in loglikelihood; Eviews tells me "SKEWT already exists and is of a wrong type". Does @iff cause this problem? Thank you!
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Logl object
Does SKEWT exist in the workfile? If so, what type of object is it?
Re: Logl object
Hello Glenn, thanks for reply!
Sorry for that stupid mistake i made. Yes, my Logl was named SKEWT.
I renamed it to SKEWT1 and now things are clear. EViews tells me "@iff is not a Genr or series expression function in SKEWT". Is there something I can do to overcome this problem? Thank you very much!
Sorry for that stupid mistake i made. Yes, my Logl was named SKEWT.
I renamed it to SKEWT1 and now things are clear. EViews tells me "@iff is not a Genr or series expression function in SKEWT". Is there something I can do to overcome this problem? Thank you very much!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Logl object
The error message is pretty clear - there is no such function as "@iff". Perhaps you mean "@iif" 
Re: Logl object
Oh, thanks a lot! It is so embarrassing to realize all my mistakes were typos.
Now everything works! ...but doesnt converge... even with restrictions and different starting values.
Now everything works! ...but doesnt converge... even with restrictions and different starting values.
Who is online
Users browsing this forum: No registered users and 2 guests
