Adding Up restrictions in LA/AIDS model

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Up restrictions in LA/AIDS model

Xia Shang
Hello all,

I have a problem about the correct way to make adding up restrictions when
I estimated the LA/AIDS model by SUREG. I estimated 5 commodities so I
should run 4 equations.  The followings are my codes:

//adding up//
constraint define 1 [q1]_cons+[q2]_cons+[q3]_cons+[q4]_cons+[q5]_cons=1
//Alfa//

constraint define 2 [q1]lnp1+[q2]lnp1+[q3]lnp1+[q4]lnp1+[q5]lnp1=0        
        //Gama//
constraint define 3 [q1]lnp2+[q2]lnp2+[q3]lnp2+[q4]lnp2+[q5]lnp2=0
constraint define 4 [q1]lnp3+[q2]lnp3+[q3]lnp3+[q4]lnp3+[q5]lnp3=0
constraint define 5 [q1]lnp4+[q2]lnp4+[q3]lnp4+[q4]lnp4+[q5]lnp4=0
constraint define 6 [q1]lnp5+[q2]lnp5+[q3]lnp5+[q4]lnp5+[q5]lnp5=0

constraint define 7 [q1]lnmp+[q2]lnmp+[q3]lnmp+[q4]lnmp+[q5]lnmp=0  
//Beta//

//homogeneity//
constraint define 8 [q1]lnp1+[q1]lnp2+[q1]lnp3+[q1]lnp4+[q1]lnp5=0
constraint define 9 [q2]lnp1+[q2]lnp2+[q2]lnp3+[q2]lnp4+[q2]lnp5=0
constraint define 10 [q3]lnp1+[q3]lnp2+[q3]lnp3+[q3]lnp4+[q3]lnp5=0
constraint define 11 [q4]lnp1+[q4]lnp2+[q4]lnp3+[q4]lnp4+[q4]lnp5=0

//symmetry//
constraint define 12 [q1]lnp2=[q2]lnp1
constraint define 13 [q1]lnp3=[q3]lnp1
constraint define 14 [q1]lnp4=[q4]lnp1
constraint define 15 [q2]lnp3=[q3]lnp2
constraint define 16 [q2]lnp4=[q4]lnp2
constraint define 17 [q3]lnp4=[q4]lnp3

global demand1 "(q1: w1 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
global demand2 "(q2: w2 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
global demand3 "(q3: w3 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
global demand4 "(q4: w4 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"

sureg $demand1 $demand2 $demand3 $demand4, const(1 2 3 4 5 6 7 8 9 10 11
12 13 14 15 16 17) isure

But STATA reports me that
 (note: constraint number 1 caused error r(303))
(note: constraint number 2 caused error r(303))
(note: constraint number 3 caused error r(303))
(note: constraint number 4 caused error r(303))
(note: constraint number 5 caused error r(303))
(note: constraint number 6 caused error r(303))
(note: constraint number 7 caused error r(303))
which means the code adding-up constraints have some problems .

Can anybody point out why they are wrong?


Thank you very much


Xia




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|

Antwort: st: Adding Up restrictions in LA/AIDS model

Richard Ochmann
...
well, in the AIDS, adding-up is fulfilled by definition, right? (see
Deaton, Muellbauer, 1980, An Almost Ideal Demand System, AER)
this is why - as you mention as well - you can only estimate J-1 equations
of a system of J equations, which you have done, as i undertand.
if this is the case, you cannot constrain explicitly on the Jth equation,
which you though try to do in constraint 1 to 7. how should stata find the
Jth equation? rather, adding-up constraints hold implicitly here when you
infer the results for the Jth equation residually. thus, you can just drop
constraint 1 to 7, if i understand your approach correctly.

best, rich

[hidden email] schrieb am 19.11.2010 16:57:59:

> Hello all,
>
> I have a problem about the correct way to make adding up restrictions
when

> I estimated the LA/AIDS model by SUREG. I estimated 5 commodities so I
> should run 4 equations.  The followings are my codes:
>
> //adding up//
> constraint define 1 [q1]_cons+[q2]_cons+[q3]_cons+[q4]_cons+[q5]_cons=1
> //Alfa//
>
> constraint define 2 [q1]lnp1+[q2]lnp1+[q3]lnp1+[q4]lnp1+[q5]lnp1=0  
>         //Gama//
> constraint define 3 [q1]lnp2+[q2]lnp2+[q3]lnp2+[q4]lnp2+[q5]lnp2=0
> constraint define 4 [q1]lnp3+[q2]lnp3+[q3]lnp3+[q4]lnp3+[q5]lnp3=0
> constraint define 5 [q1]lnp4+[q2]lnp4+[q3]lnp4+[q4]lnp4+[q5]lnp4=0
> constraint define 6 [q1]lnp5+[q2]lnp5+[q3]lnp5+[q4]lnp5+[q5]lnp5=0
>
> constraint define 7 [q1]lnmp+[q2]lnmp+[q3]lnmp+[q4]lnmp+[q5]lnmp=0
> //Beta//
>
> //homogeneity//
> constraint define 8 [q1]lnp1+[q1]lnp2+[q1]lnp3+[q1]lnp4+[q1]lnp5=0
> constraint define 9 [q2]lnp1+[q2]lnp2+[q2]lnp3+[q2]lnp4+[q2]lnp5=0
> constraint define 10 [q3]lnp1+[q3]lnp2+[q3]lnp3+[q3]lnp4+[q3]lnp5=0
> constraint define 11 [q4]lnp1+[q4]lnp2+[q4]lnp3+[q4]lnp4+[q4]lnp5=0
>
> //symmetry//
> constraint define 12 [q1]lnp2=[q2]lnp1
> constraint define 13 [q1]lnp3=[q3]lnp1
> constraint define 14 [q1]lnp4=[q4]lnp1
> constraint define 15 [q2]lnp3=[q3]lnp2
> constraint define 16 [q2]lnp4=[q4]lnp2
> constraint define 17 [q3]lnp4=[q4]lnp3
>
> global demand1 "(q1: w1 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
> global demand2 "(q2: w2 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
> global demand3 "(q3: w3 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
> global demand4 "(q4: w4 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
>
> sureg $demand1 $demand2 $demand3 $demand4, const(1 2 3 4 5 6 7 8 9 10 11
> 12 13 14 15 16 17) isure
>
> But STATA reports me that
>  (note: constraint number 1 caused error r(303))
> (note: constraint number 2 caused error r(303))
> (note: constraint number 3 caused error r(303))
> (note: constraint number 4 caused error r(303))
> (note: constraint number 5 caused error r(303))
> (note: constraint number 6 caused error r(303))
> (note: constraint number 7 caused error r(303))
> which means the code adding-up constraints have some problems .
>
> Can anybody point out why they are wrong?
>
>
> Thank you very much
>
>
> Xia
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|

RE: Antwort: st: Adding Up restrictions in LA/AIDS model

Xia Shang
Dear Rich,
Thank you so much for your reply. Yes, you are right, if I dropped
constraint 1 to 7, it works, and no errors were reported. I am a beginner,
so you mean that if I dropped constraint 1 to 7, I can also calculate the
alpha, beta, and gamma of equation 5 by the adding up restrictions, which
are (1-alfa), (0-beta), and (0-gamma)?

I appreciate your help.

Regards,
Xia
-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Richard Ochmann
Sent: Friday, November 19, 2010 10:53 AM
To: [hidden email]
Subject: Antwort: st: Adding Up restrictions in LA/AIDS model

...
well, in the AIDS, adding-up is fulfilled by definition, right? (see
Deaton, Muellbauer, 1980, An Almost Ideal Demand System, AER)
this is why - as you mention as well - you can only estimate J-1 equations
of a system of J equations, which you have done, as i undertand.
if this is the case, you cannot constrain explicitly on the Jth equation,
which you though try to do in constraint 1 to 7. how should stata find the
Jth equation? rather, adding-up constraints hold implicitly here when you
infer the results for the Jth equation residually. thus, you can just drop
constraint 1 to 7, if i understand your approach correctly.

best, rich

[hidden email] schrieb am 19.11.2010 16:57:59:

> Hello all,
>
> I have a problem about the correct way to make adding up restrictions
when

> I estimated the LA/AIDS model by SUREG. I estimated 5 commodities so I
> should run 4 equations.  The followings are my codes:
>
> //adding up//
> constraint define 1 [q1]_cons+[q2]_cons+[q3]_cons+[q4]_cons+[q5]_cons=1
> //Alfa//
>
> constraint define 2 [q1]lnp1+[q2]lnp1+[q3]lnp1+[q4]lnp1+[q5]lnp1=0  
>         //Gama//
> constraint define 3 [q1]lnp2+[q2]lnp2+[q3]lnp2+[q4]lnp2+[q5]lnp2=0
> constraint define 4 [q1]lnp3+[q2]lnp3+[q3]lnp3+[q4]lnp3+[q5]lnp3=0
> constraint define 5 [q1]lnp4+[q2]lnp4+[q3]lnp4+[q4]lnp4+[q5]lnp4=0
> constraint define 6 [q1]lnp5+[q2]lnp5+[q3]lnp5+[q4]lnp5+[q5]lnp5=0
>
> constraint define 7 [q1]lnmp+[q2]lnmp+[q3]lnmp+[q4]lnmp+[q5]lnmp=0
> //Beta//
>
> //homogeneity//
> constraint define 8 [q1]lnp1+[q1]lnp2+[q1]lnp3+[q1]lnp4+[q1]lnp5=0
> constraint define 9 [q2]lnp1+[q2]lnp2+[q2]lnp3+[q2]lnp4+[q2]lnp5=0
> constraint define 10 [q3]lnp1+[q3]lnp2+[q3]lnp3+[q3]lnp4+[q3]lnp5=0
> constraint define 11 [q4]lnp1+[q4]lnp2+[q4]lnp3+[q4]lnp4+[q4]lnp5=0
>
> //symmetry//
> constraint define 12 [q1]lnp2=[q2]lnp1
> constraint define 13 [q1]lnp3=[q3]lnp1
> constraint define 14 [q1]lnp4=[q4]lnp1
> constraint define 15 [q2]lnp3=[q3]lnp2
> constraint define 16 [q2]lnp4=[q4]lnp2
> constraint define 17 [q3]lnp4=[q4]lnp3
>
> global demand1 "(q1: w1 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
> global demand2 "(q2: w2 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
> global demand3 "(q3: w3 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
> global demand4 "(q4: w4 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
>
> sureg $demand1 $demand2 $demand3 $demand4, const(1 2 3 4 5 6 7 8 9 10 11
> 12 13 14 15 16 17) isure
>
> But STATA reports me that
>  (note: constraint number 1 caused error r(303))
> (note: constraint number 2 caused error r(303))
> (note: constraint number 3 caused error r(303))
> (note: constraint number 4 caused error r(303))
> (note: constraint number 5 caused error r(303))
> (note: constraint number 6 caused error r(303))
> (note: constraint number 7 caused error r(303))
> which means the code adding-up constraints have some problems .
>
> Can anybody point out why they are wrong?
>
>
> Thank you very much
>
>
> Xia
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|

Antwort: RE: Antwort: st: Adding Up restrictions in LA/AIDS model

Richard Ochmann

...
adding-up is defined in Deaton, Muellbauer (1980) in Eq.(10). From these restrictions, you can calculate the respective coefficients for the left-out equation residually. So yes, you can drop your constraints 1 to 7, and you will see that adding-up of the predicted shares to unity is fulfilled if you infer the residual coefficients as explained - provided your system is set up as an AIDS demand system.

Deaton, Muellbauer, 1980, An Almost Ideal Demand System, AER

best, rich

-----[hidden email] schrieb: -----

>An: <[hidden email]>
>Von: "Xia Shang" <[hidden email]>
>Gesendet von: [hidden email]
>Datum: 19.11.2010 06:07PM
>Thema: RE: Antwort: st: Adding Up restrictions in LA/AIDS model
>
>Dear Rich,
>Thank you so much for your reply. Yes, you are right, if I dropped
>constraint 1 to 7, it works, and no errors were reported. I am a
>beginner,
>so you mean that if I dropped constraint 1 to 7, I can also calculate
>the
>alpha, beta, and gamma of equation 5 by the adding up restrictions,
>which
>are (1-alfa), (0-beta), and (0-gamma)?
>
>I appreciate your help.
>
>Regards,
>Xia
>-----Original Message-----
>From: [hidden email]
>[[hidden email]] On Behalf Of Richard
>Ochmann
>Sent: Friday, November 19, 2010 10:53 AM
>To: [hidden email]
>Subject: Antwort: st: Adding Up restrictions in LA/AIDS model
>
>...
>well, in the AIDS, adding-up is fulfilled by definition, right? (see
>Deaton, Muellbauer, 1980, An Almost Ideal Demand System, AER)
>this is why - as you mention as well - you can only estimate J-1
>equations
>of a system of J equations, which you have done, as i undertand.
>if this is the case, you cannot constrain explicitly on the Jth
>equation,
>which you though try to do in constraint 1 to 7. how should stata
>find the
>Jth equation? rather, adding-up constraints hold implicitly here when
>you
>infer the results for the Jth equation residually. thus, you can just
>drop
>constraint 1 to 7, if i understand your approach correctly.
>
>best, rich
>
>[hidden email] schrieb am 19.11.2010 16:57:59:
>
>> Hello all,
>>
>> I have a problem about the correct way to make adding up
>restrictions
>when
>> I estimated the LA/AIDS model by SUREG. I estimated 5 commodities
>so I
>> should run 4 equations.  The followings are my codes:
>>
>> //adding up//
>> constraint define 1
>[q1]_cons+[q2]_cons+[q3]_cons+[q4]_cons+[q5]_cons=1
>> //Alfa//
>>
>> constraint define 2 [q1]lnp1+[q2]lnp1+[q3]lnp1+[q4]lnp1+[q5]lnp1=0
>
>>         //Gama//
>> constraint define 3 [q1]lnp2+[q2]lnp2+[q3]lnp2+[q4]lnp2+[q5]lnp2=0
>> constraint define 4 [q1]lnp3+[q2]lnp3+[q3]lnp3+[q4]lnp3+[q5]lnp3=0
>> constraint define 5 [q1]lnp4+[q2]lnp4+[q3]lnp4+[q4]lnp4+[q5]lnp4=0
>> constraint define 6 [q1]lnp5+[q2]lnp5+[q3]lnp5+[q4]lnp5+[q5]lnp5=0
>>
>> constraint define 7 [q1]lnmp+[q2]lnmp+[q3]lnmp+[q4]lnmp+[q5]lnmp=0
>> //Beta//
>>
>> //homogeneity//
>> constraint define 8 [q1]lnp1+[q1]lnp2+[q1]lnp3+[q1]lnp4+[q1]lnp5=0
>> constraint define 9 [q2]lnp1+[q2]lnp2+[q2]lnp3+[q2]lnp4+[q2]lnp5=0
>> constraint define 10 [q3]lnp1+[q3]lnp2+[q3]lnp3+[q3]lnp4+[q3]lnp5=0
>> constraint define 11 [q4]lnp1+[q4]lnp2+[q4]lnp3+[q4]lnp4+[q4]lnp5=0
>>
>> //symmetry//
>> constraint define 12 [q1]lnp2=[q2]lnp1
>> constraint define 13 [q1]lnp3=[q3]lnp1
>> constraint define 14 [q1]lnp4=[q4]lnp1
>> constraint define 15 [q2]lnp3=[q3]lnp2
>> constraint define 16 [q2]lnp4=[q4]lnp2
>> constraint define 17 [q3]lnp4=[q4]lnp3
>>
>> global demand1 "(q1: w1 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
>> global demand2 "(q2: w2 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
>> global demand3 "(q3: w3 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
>> global demand4 "(q4: w4 lnp1 lnp2 lnp3 lnp4 lnp5 lnmp)"
>>
>> sureg $demand1 $demand2 $demand3 $demand4, const(1 2 3 4 5 6 7 8 9
>10 11
>> 12 13 14 15 16 17) isure
>>
>> But STATA reports me that
>>  (note: constraint number 1 caused error r(303))
>> (note: constraint number 2 caused error r(303))
>> (note: constraint number 3 caused error r(303))
>> (note: constraint number 4 caused error r(303))
>> (note: constraint number 5 caused error r(303))
>> (note: constraint number 6 caused error r(303))
>> (note: constraint number 7 caused error r(303))
>> which means the code adding-up constraints have some problems .
>>
>> Can anybody point out why they are wrong?
>>
>>
>> Thank you very much
>>
>>
>> Xia
>>
>>
>>
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>
>*
>*   For searches and help try:
>*   http://www.stata.com/help.cgi?search
>*   http://www.stata.com/support/statalist/faq
>*   http://www.ats.ucla.edu/stat/stata/
>
>
>*
>*   For searches and help try:
>*   http://www.stata.com/help.cgi?search
>*   http://www.stata.com/support/statalist/faq
>*   http://www.ats.ucla.edu/stat/stata/

Reply | Threaded
Open this post in threaded view
|

Re: Adding Up restrictions in LA/AIDS model

Daniela
This post has NOT been accepted by the mailing list yet.
In reply to this post by Xia Shang
How can I estimate the Deaton and Muellbauer's Almost Ideal linear Demand  System in Stata using seemingly unrelated regression if im dealing with just one commodity?
How would my   coe of the restrictions change   and of the estimatin itself?
Reply | Threaded
Open this post in threaded view
|

Re: Adding Up restrictions in LA/AIDS model

Daniela
This post has NOT been accepted by the mailing list yet.
In reply to this post by Xia Shang
ow can I estimate the Deaton and Muellbauer's Almost Ideal linear Demand
System in Stata using seemingly unrelated regression if im dealing with just
one commodity?
How would my   code of the restrictions change   and of the estimatin itself?