Logl object

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

XYZXYZ
Posts: 4
Joined: Sat Sep 15, 2012 11:39 pm

Logl object

Postby XYZXYZ » Sat Sep 15, 2012 11:53 pm

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!

XYZXYZ
Posts: 4
Joined: Sat Sep 15, 2012 11:39 pm

Re: Logl object

Postby XYZXYZ » Sun Sep 16, 2012 3:00 am

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!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Logl object

Postby EViews Glenn » Mon Sep 17, 2012 9:38 am

Does SKEWT exist in the workfile? If so, what type of object is it?

XYZXYZ
Posts: 4
Joined: Sat Sep 15, 2012 11:39 pm

Re: Logl object

Postby XYZXYZ » Tue Sep 18, 2012 11:35 pm

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!

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

Re: Logl object

Postby EViews Gareth » Wed Sep 19, 2012 6:50 am

The error message is pretty clear - there is no such function as "@iff". Perhaps you mean "@iif" :wink:

XYZXYZ
Posts: 4
Joined: Sat Sep 15, 2012 11:39 pm

Re: Logl object

Postby XYZXYZ » Thu Sep 20, 2012 9:46 am

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.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests