$TITLE: M5-6.GMS, structural estimation and GE counter-factuals using MPEC * then estimate used for a general-equilibrium counterfactual * motivated by Fieler (2011) and Caron, Fally, Markusen (2012) $ONTEXT There are I consumers, each with an observed consumption of X1, X2, and income M. The objective is to fit the data to a CRIE (constant relative income elasticity) utility function of the form: U = X1**A1 + X2**A2 where A1 and A2 are common across consumers and where A1 and A2 are the parameters to estimate. There are NO CLOSED-FORM DEMAND FUNCTIONS FOR THESE PREFERENCES to be consistent with theory, the fitted values of XHAT1 and XHAT2 for each consumer i satisfy (1) adding up: XHAT1(I) + XHAT2(I) = M(I) where income is M and prices are all assume equal to one everywhere. (2) the XHATs are consistent with the FOC for utility maxmimization where LA(I) will be the (endogenous) lambda: marginal utility of income for country i. Initial data is micro-consistent: satisfies adding up, but you can change that by altering a number in BENCH(i,j) $OFFTEXT SETS I individuals /I1*I6/ J observations on individuals /J1*J3/ K(J) goods X1 and X2 /J1*J2/ M(J) income /J3/; ALIAS(K, KK); PARAMETERS X0(I,K) initial demand for good k by consumer i M0(I,M) income of consumer i MI(I) income of consumer i; TABLE BENCH(I,J) inital observed data for I = 6 individuals J1 J2 J3 I1 1 1 2 I2 2.2 1.8 4 I3 3.6 2.4 6 I4 5 3 8 I5 6.5 3.5 10 I6 8 4 12; DISPLAY BENCH; X0(I,K) = BENCH(I, K); M0(I,M) = BENCH(I, M); MI(I) = M0(I,"J3"); DISPLAY X0, M0, MI; VARIABLES DEV sum of squared deviations; NONNEGATIVE VARIABLES LA(I) marginal utility of income for individual i A(K) exponents in the utility function XHAT(I,K) fitted values of the dependent variable; EQUATIONS OBJECTIVE objective function = sum of squared residuals EXHAT(I,K) equation for the fitted values of X (the FOC for U-max) ADDUP(I) income adding up condition NORM(K) normalization constraint that the sum of A over K = 1; OBJECTIVE.. DEV =E= SUM(I, SUM(K, (XHAT(I,K) - X0(I,K))*(XHAT(I,K) - X0(I,K)))); EXHAT(I,K).. LA(I) =G= A(K)*XHAT(I,K)**(A(K)-1); ADDUP(I).. SUM(K, XHAT(I,K)) =E= MI(I); NORM(K).. SUM(KK, A(KK)) =E= 1; LA.L(I) = 1; A.L(K) = 0.5; XHAT.L(I,K) = 1; DEV.L = 1; MODEL MPEC /OBJECTIVE, EXHAT.XHAT, ADDUP.LA, NORM.A/; OPTION MPEC = nlpec; SOLVE MPEC USING MPEC MINIMIZING DEV; * extract the income elasticities of demand ETA(I,K) * see Fieler (2011) Caron, Fally and Markusen (2012) for the algebra PARAMETERS SIGMA(K) quasi price elasticity of good k ETA(I,K) income elasticity of demand for good k in countryi ETAMEAN(K) income elascitities at mean income CHECK(I) check that the ratios of eta1 over eta2 is constant in i; SIGMA(K) = 1/(1-A.L(K)); ETA(I,K) = SIGMA(K)*SUM(KK, XHAT.L(I,KK))/(SUM(KK, SIGMA(KK)*XHAT.L(I,KK))); ETAMEAN(K) = SIGMA(K)*SUM(KK, SUM(I,XHAT.L(I,KK))/CARD(I))/ (SUM(KK, SUM(I,SIGMA(KK)*XHAT.L(I,KK))/CARD(I))); CHECK(I) = ETA(I,"J1")/ETA(I,"J2"); DISPLAY SIGMA, ETA, ETAMEAN, CHECK; * now we can do general-equilibrium counter factuals * example: double everyone's income. New XHATs solved as an MCP MI(I) = 2*MI(I); PARAMETERS ABAR(K) estimated A(K) stored as a parameter XHAT0(I,K) fitted XHAT(I K) stored as a parameter CHANGEX(I,K) proportional change in X when income is doubled; ABAR(K) = A.L(K); XHAT0(I,K) = XHAT.L(I,K); EQUATIONS EXHAT2(I,K) new equation for XHAT with A(K) as a parameter ADDUP2(I) same equation for adding up; EXHAT2(I,K).. LA(I) =G= ABAR(K)*XHAT(I,K)**(ABAR(K)-1); ADDUP2(I).. SUM(K, XHAT(I,K)) =E= MI(I); MODEL COUNTER /EXHAT2.XHAT, ADDUP2.LA/; SOLVE COUNTER USING MCP; CHANGEX(I,K) = (XHAT.L(I,K)-XHAT0(I,K))/XHAT0(I,K); DISPLAY CHANGEX;