Programming a System of Equations

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

canboardrp
Posts: 17
Joined: Tue Mar 06, 2012 9:11 am

Programming a System of Equations

Postby canboardrp » Tue Mar 06, 2012 9:14 am

What I need to do is estimate a few reaction functions as a system, so the coefficient’s (cross-price elasticities) are the same.

For example, I have reaction functions for shares of Natural Gas, Light Fuel Oil (LFO) and Electricity:

equation rsgas.ls rsgas c rpgas rplfo rpele
equation rslfo.ls rslfo c rpgas rplfo rpele
equation rsele.ls rsele c rpgas rplfo rpele

I know I need to drop one equation to avoid over-determination (say LFO) and then estimate the electricity and the natural gas equations at the same time with the cross-price elasticity coefficients constrained to equal each other and then the fuel oil share would be 1- the estimated shares of natural gas and electricity. However, I’m not exactly sure how to program this into E-views

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

Re: Programming a System of Equations

Postby EViews Gareth » Tue Mar 06, 2012 9:50 am

You need to use a system object rather than the equation object. Something like:

Code: Select all

system s s.append rsgas = c(1) + c(2)*rpgas + c(3)*rplfo + c(4)*rpele s.append rsele = c(5) + c(4)*rpgas + c(6)*rplfo + c(7)*rpele s.append rslfo = c(8) + (1-c(4)-c(2))*rpgas + c(9)*rplfo + (1-c(4)-c(7))*rpele s.ls
(Note I didn't pay exact attention to the specification I used up there, just chose something to give you an idea of how you can constrain coefficients).

canboardrp
Posts: 17
Joined: Tue Mar 06, 2012 9:11 am

Re: Programming a System of Equations

Postby canboardrp » Tue Mar 06, 2012 10:49 am

Thanks for the help!

If after testing I want to try a different specification (say take the natural logs of all the variables), how would you program that specification into the system object?

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

Re: Programming a System of Equations

Postby EViews Gareth » Tue Mar 06, 2012 10:50 am

Put @log() around the variables.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest