Page 1 of 1

Logl object

Posted: Sat Sep 15, 2012 11:53 pm
by XYZXYZ
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!

Re: Logl object

Posted: Sun Sep 16, 2012 3:00 am
by XYZXYZ
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!

Re: Logl object

Posted: Mon Sep 17, 2012 9:38 am
by EViews Glenn
Does SKEWT exist in the workfile? If so, what type of object is it?

Re: Logl object

Posted: Tue Sep 18, 2012 11:35 pm
by XYZXYZ
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!

Re: Logl object

Posted: Wed Sep 19, 2012 6:50 am
by EViews Gareth
The error message is pretty clear - there is no such function as "@iff". Perhaps you mean "@iif" :wink:

Re: Logl object

Posted: Thu Sep 20, 2012 9:46 am
by XYZXYZ
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.