Page 1 of 1

From Troll to Eviews

Posted: Wed Aug 26, 2015 12:25 pm
by tvonbrasch
Hi

Im trying to make a code so that we can use a Troll model in Eviews.

In Troll you have to specify endogenous and exogenous variables, while in Eviews, the first left hand side variable is endogenous.

To overcome this difference, and if x is endogenous in a specific equation, I thougt I could add on a 0*x to that particular equation. in our Troll model we have about 3000 equations, and I have now added a 0*endogenous to each equation, so that there are as many endogenous variables as equations. however, when doing this, I get the message

Unable to normalize equation for U65 because it appears more than once to the left of equal sign. in "0 * U65 + d(LOG(U65) , 1) = UR65 "

It seems that my way of doing this generates a problem when the endogenous variable is already on the left of the equal sign? is there a way of dealing with this issue?
Thomas

Re: From Troll to Eviews

Posted: Wed Aug 26, 2015 1:11 pm
by EViews Gareth
I think the only way to deal with it is to not add the 0* bit :D

Re: From Troll to Eviews

Posted: Thu Aug 27, 2015 5:17 am
by tvonbrasch
Hi, point taken :-).

But, I get the same problem with the equation
d(LOG(yp1519 / (1 - yp1519)) , 1) = YPR1519 + YPrcon1519 + Ypcon1519(1) + Ypcon1519(2) * DUM883 + Ypcon1519(3) * DUM912 + Ypcon1519(4) * DUM962 + Ypcon1519(5) * DUM994 + Ypcon1519(6) * DUM061 + Ypcon1519(7) * dum081 + Ypcon1519(8) * d(LOG(yp1519(-1) / (1 - yp1519(-1))) , 1) + Ypcon1519(9) * d(LOG(yp1519(-2) / (1 - yp1519(-2))) , 1) + Ypcon1519(10) * d(LOG(yp1519(-3) / (1 - yp1519(-3))) , 1) + Ypcon1519(11) * d(LOG(yp1519(-4) / (1 - yp1519(-4))) , 1) + Ypcon1519(12) * LOG(yp1519(-1) / (1 - yp1519(-1))) + Ypcon1519(13) * d(LOG(URKORR(-4)) , 1) + Ypcon1519(14) * LOG(URKORR(-2)) + Ypcon1519(15) * d(LOG(WWK(-2) * (1 - TGW(-2)) / KPI(-2)) , 1) + Ypcon1519(16) * LOG(WWK(-1) * (1 - TGW(-1)) / KPI(-1))

Is it not possible to write an equation in a model as the one above without respecifying it?

Re: From Troll to Eviews

Posted: Thu Aug 27, 2015 7:41 am
by EViews Gareth
Correct.

Logit and models

Posted: Tue Jan 05, 2016 3:53 am
by tvonbrasch
Hi

Can you please provide a suggestion for how to include a logistic type of equation into a model object?

Many equations in our models are estimated in the form
log(x/(1-x)) = .....

however, when including the equation into a model object Eviews cannot handle it because the endogenous variable occurs more than once on the left hand side of the equality sign.

I thought i could use the build in function @qlogistic(x) and include the equation
@qlogistic(x) = ....

but this does not work either.

If we have a set of equations of the form log(x/(1-x)) = ....., what is the best/easiest way to include these equations in a model object?

If you could make a small code that could easily be made into an addin I would greatly appreciate it. One of the nice things with Eviews is how easy it is to go from estimation to model simulation. This should also apply to logistic functions as they are so often used in applied work.

Thomas

Re: From Troll to Eviews

Posted: Tue Jan 05, 2016 6:29 am
by trubador
This is also one of the forms that EViews cannot normalize. You can generate a single series to hold log odds ratio and transform it back afterwards with another identity equation:

Code: Select all

series p = log(y/(1-y))
equation eq1.ls p c x1 x2
model mod1
mod1.merge eq1
mod1.append y = @logit(p)

Re: From Troll to Eviews

Posted: Tue Jan 05, 2016 6:53 am
by tvonbrasch
Hi

thanks for this!

I thought about rewriting the equation

log(x/(1-x)) = RHS

as

x=x+RHS- log(x/(1-x)) or 0*x=RHS- log(x/(1-x))

but im not sure if that creates a problem when solving the model .... i just tried it and i got the message that "Solve terminated - Unable to compute due to missing data in "X = X - 1.30548150171 + 0.00220462554524 * I + 0.035991421899 * ..."

do you know why this does not work?
T

Re: From Troll to Eviews

Posted: Tue Jan 05, 2016 7:04 am
by trubador
Nice workaround. Yes, it should also work. I don't think it has anything to do with the specification. It may be related to chosen sample period.

Re: From Troll to Eviews

Posted: Tue Jan 05, 2016 7:20 am
by tvonbrasch
You were right,

it worked when I chose another sample period (with positive observations for all variables)

Thanks again!
T