Page 1 of 1

Programming a System of Equations

Posted: Tue Mar 06, 2012 9:14 am
by canboardrp
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

Re: Programming a System of Equations

Posted: Tue Mar 06, 2012 9:50 am
by EViews Gareth
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).

Re: Programming a System of Equations

Posted: Tue Mar 06, 2012 10:49 am
by canboardrp
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?

Re: Programming a System of Equations

Posted: Tue Mar 06, 2012 10:50 am
by EViews Gareth
Put @log() around the variables.