Basic question on setting up EViews object

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

Moderators: EViews Gareth, EViews Moderator

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Basic question on setting up EViews object

Postby tzink » Thu Nov 01, 2012 2:04 pm

I am trying to set up a basic model in eviews, and I'm having trouble in the first steps.

Take for a very simple supply and demand model:

(1) D = f(P, x)
(2) S = f(P, y)
(3) S = D

where P is the endogenous price, x and y are exogenous regressors, and the identity holds that supply equals demand. We should thus have three endogenous variables (S,D,P) and three equations. Seems simple, yet I can't figure out how to implement it in a EViews model object.

Here's the program I wrote to try and accomplish this:

Code: Select all

WFCREATE SD.wf1 M 2002:01 2012:12
MODEL _supplydemand
_supplydemand.append D = f*(P + x)
_supplydemand.append S = f*(P + y)
_supplydemand.append S = D

The first problem is that this simply doesn't work--there are plenty of errors when I open the model object. It fails in a couple of ways, as far as I can tell. First, S is defined twice, and for some reason it can't tell that eq (3) is an identity, so it complains. It seems to think eq (1) is "too complex" or has a syntax error, but I can't see how either one is true.

The second problem is I have no way of telling EViews that P is endogenous. From the manual, I see that variables are made endogenous by beginning an equation with that variable. But in this case, I don't see a way to begin any equation with P...

Maybe I'm just being slow, but this seems overly confusing. I'm coming from GRETL, where I would just create a system, call out equations (1)-(3), and then simply list which variables are endogenous. It doesn't seem quite so easy in EViews...

Any help is appreciated.

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

Re: Basic question on setting up EViews object

Postby EViews Gareth » Thu Nov 01, 2012 2:12 pm

Models in EViews don't really work like that. You're probably best off reading through Jean Louis Brillet's book to get an idea of how to create and manage a model:
viewtopic.php?f=10&t=5914
Follow us on Twitter @IHSEViews

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Re: Basic question on setting up EViews object

Postby tzink » Thu Nov 01, 2012 2:26 pm

Thanks Gareth
It's actually Brillet's book that convinced me to use EViews for this sort of thing. Unfortunately all the examples I can find in his book and in the documentation are macro models, which I can't readily apply to my situation. Maybe I just need a shove in the right direction here. How would you go about creating that simple supply and demand model in EViews?

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

Re: Basic question on setting up EViews object

Postby EViews Gareth » Thu Nov 01, 2012 2:36 pm

Do you have data? Have you estimated your equations? What are you trying to achieve?
Follow us on Twitter @IHSEViews

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Re: Basic question on setting up EViews object

Postby tzink » Thu Nov 01, 2012 2:39 pm

Yes, I have data and I can estimate the equations. In Brillet's book (pp. 95-99) he talks about how you can set up the structure of a model without actually using any data. This seems like a very useful feature to me, which is why I'm trying to get it to work without invoking my data.

Obviously my actual situation is more involved than the three equation model I presented in the OP, but it seems like I should be able to get that working as a minimum before building up complexity.

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

Re: Basic question on setting up EViews object

Postby EViews Gareth » Thu Nov 01, 2012 2:49 pm

Here's a quick and dirty example:

Code: Select all

create u 100
series x=100
series y=5

model m
m.append supply = 0.5 + 3*price + 6*x
m.append price*0 + demand = 3+0.5*price + 7*y
m.append @identity demand=supply

m.solve


You correctly point out that EViews will use the first variable found in an equation as the endogenous variable. To make P endogenous, I simply put it as the first variable in the second equation. Note that I tricked EViews by actually just putting price*0 at the start of the equation. This doesn't effect the demand equation in any way other than by letting EViews know that Price is endogenous.

You'll also note that I used @identity to state that the third equation is an identity.
Follow us on Twitter @IHSEViews

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Re: Basic question on setting up EViews object

Postby tzink » Thu Nov 01, 2012 3:00 pm

Ok... that works!
That's a great trick to put price*0 in eq (2).
It turns out my syntax error messages had to do with my use of one-letter variables... Once I changed them to "supply" "demand" and "price" it works... As S,D and P it fails. Is that generally not allowed in EViews?

Also, is there any benefit to requiring endogenous variables to be indicated in this way? Wouldn't it be easier to just let the user specify which are endogenous via a drop-down or something like @endog?

Thanks for your help. I'll carry on with my problem, and if I get stuck, I'll be back :)

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

Re: Basic question on setting up EViews object

Postby EViews Gareth » Thu Nov 01, 2012 3:28 pm

You're not allowed a series called "D", since "D" is the difference operator.
Follow us on Twitter @IHSEViews

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Re: Basic question on setting up EViews object

Postby tzink » Thu Nov 01, 2012 3:29 pm

Ah, right. Thanks!

jlbrillet
Posts: 39
Joined: Mon Feb 16, 2009 6:03 am

Re: Basic question on setting up EViews object

Postby jlbrillet » Thu Mar 14, 2013 1:35 am

A late hello....

Eviews registers as endogenous the FIRST variable in the equation. So D, S and P should appear once, and once only, as the first element.

This means this model will not work :

D = f(P, x)

S= f(P,y)

S = D

But you can :

* Invert the fiirst equation to give P.

* Permute one equation, giving for instance :

D = f(P, x)

f(P,y) = S

S = D

I hope this hels.

jean Louis B.


Return to “Models”

Who is online

Users browsing this forum: No registered users and 1 guest