$TITLE: M2-2.GMS: consumer choice, modeled as an NLP and a MCP * maximize utility subject to a linear budget constraint * two goods, Cobb-Douglas preferences $ONTEXT This program introduces economic students to GAMS and GAMS solvers. The problem itself is known and loved by all econ students from undergraduate intermediate micro economics on up: Maximizing utility with two goods and a linear budget constraint. Four versions are considered OPTIMIZE: direct constrained optimization using the NLP (non-linear programming) solver COMPLEM: uses the first-order conditions (FOC) to create a square system of n inequalities in n unknowns, solved using the MCP (mixed complementarity problem) solver COMPLEM2: instead of the utility function and FOC, uses the expenditure function and Marshallian demand functions, solved as an MCP COMPLEM3: instead of the utility function and FOC, uses the expenditure function and Hicksian demand functions, solved as an MCP $OFFTEXT PARAMETERS M Income P1, P2 prices of goods X1 and X2 S1, S2 utility shares of X1 and X2; M = 100; P1 = 1; P2 = 1; S1 = 0.5; S2 = 0.5; NONNEGATIVE VARIABLES X1, X2 Commodity demands LAMBDA Lagrangean multiplier (marginal utility of income); VARIABLES U Welfare; EQUATIONS UTILITY Utility INCOME Income-expenditure constraint FOC1, FOC2 First-order conditions for X1 and X2; UTILITY.. U =E= 2*(X1**S1)*(X2**S2); INCOME.. M =G= P1*X1 + P2*X2; FOC1.. LAMBDA*P1 =G= 2*S1*X1**(S1-1)*(X2**S2); FOC2.. LAMBDA*P2 =G= 2*S2*X2**(S2-1)*(X1**S1); * set starting values U.L = 100; X1.L = 50; X2.L = 50; LAMBDA.L = 1; * modeled as a non-linear programming problem MODEL OPTIMIZE /UTILITY, INCOME/; SOLVE OPTIMIZE USING NLP MAXIMIZING U; * modeled as a complementarity problem MODEL COMPLEM /UTILITY.U, INCOME.LAMBDA, FOC1.X1, FOC2.X2/; SOLVE COMPLEM USING MCP; * counterfactuals P1 = 2; SOLVE OPTIMIZE USING NLP MAXIMZING U; SOLVE COMPLEM USING MCP; P1 = 1; M = 200; SOLVE OPTIMIZE USING NLP MAXIMZING U; SOLVE COMPLEM USING MCP; * now use the expenditure function, giving the minimum cost of buying * one unit of utility: COSTU = P1**S1 * P2**S2 = PU * where PU is the "price" of utility: the inverse of lambda * two versions are presented: * one using Marshallian (uncompensated) demand: X_i = F_i(P1, P2, M) * one using Hicksian (compensated) demand: X_i = F_i(P1, P2, U) P1 = 1; M = 100; NONNEGATIVE VARIABLES PU price of utility; EQUATIONS COSTU expenditure function: cost of producing utility = PU DEMANDM1 Marshallian demand for good 1 DEMANDM2 Marshallian demand for good 2 DEMANDH1 Hicksian demand for good 1 DEMANDH2 Hicksian demand for good 2 DEMANDU Demand for utility (indirect utility function); COSTU.. P1**S1 * P2**S2 =G= PU; DEMANDM1.. X1 =G= S1*M/P1; DEMANDM2.. X2 =G= S2*M/P2; DEMANDH1.. X1 =G= S1*PU*U/P1; DEMANDH2.. X2 =G= S2*PU*U/P2; DEMANDU.. U =E= M/PU; PU.L = 1; MODEL COMPLEM2 marshall /COSTU.U, DEMANDM1.X1, DEMANDM2.X2, DEMANDU.PU/; MODEL COMPLEM3 hicks /COSTU.U, DEMANDH1.X1, DEMANDH2.X2, DEMANDU.PU/; SOLVE COMPLEM2 USING MCP; SOLVE COMPLEM3 USING MCP; * counterfactuals P1 = 2; SOLVE COMPLEM2 USING MCP; SOLVE COMPLEM3 USING MCP; P1 = 1; M = 200; SOLVE COMPLEM2 USING MCP; SOLVE COMPLEM3 USING MCP;