## From Troll to Eviews

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

tvonbrasch
Posts: 442
Joined: Fri Apr 15, 2011 5:35 am

### From Troll to Eviews

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

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

### Re: From Troll to Eviews

I think the only way to deal with it is to not add the 0* bit tvonbrasch
Posts: 442
Joined: Fri Apr 15, 2011 5:35 am

### Re: From Troll to Eviews

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?

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

### Re: From Troll to Eviews

Correct.

tvonbrasch
Posts: 442
Joined: Fri Apr 15, 2011 5:35 am

### Logit and models

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

Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

### Re: From Troll to Eviews

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 x2model mod1mod1.merge eq1mod1.append y = @logit(p)`

tvonbrasch
Posts: 442
Joined: Fri Apr 15, 2011 5:35 am

### Re: From Troll to Eviews

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

Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

### Re: From Troll to Eviews

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.

tvonbrasch
Posts: 442
Joined: Fri Apr 15, 2011 5:35 am

### Re: From Troll to Eviews

You were right,

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

Thanks again!
T