Josefina Martinez
Department of Economics
University of Colorado
$TITLE Model M1_1S: Closed 2x2 Economy --A Quick Introduction to the Basics $ontext Production Sectors Consumers Markets | X Y W | CONS ------------------------------------------------------ PX | 100 -100 | PY | 100 -100 | PW | 200 | -200 PL | -40 -60 | 100 PK | -60 -40 | 100 ------------------------------------------------------ $offtext * Declare GAMS parameters which we will use in model specification. * X0 will be used in exercise (2). SCALAR TX Ad-valorem tax rate for X sector inputs /0/, LENDOW Labor endowment multiplier /1/, X0 Benchmark value of X /100/; $ONTEXT $MODEL:M1_1S $SECTORS: X ! Activity level for sector X Y ! Activity level for sector Y W ! Activity level for sector W (Hicksian welfare index) $COMMODITIES: PX ! Price index for commodity X PY ! Price index for commodity Y PL ! Price index for primary factor L PK ! Price index for primary factor K PW ! Price index for welfare (expenditure function) $CONSUMERS: CONS ! Income level for consumer CONS * Cobb-Douglas technology is characterized by unitary elasticity * of substitution at the top level (s:1). $PROD:X s:1 O:PX Q:X0 I:PL Q:40 A:CONS T:TX I:PK Q:60 A:CONS T:TX $PROD:Y s:1 O:PY Q:100 I:PL Q:60 I:PK Q:40 $PROD:W s:1 O:PW Q:200 I:PX Q:100 I:PY Q:100 * This function represents preferences (using reference * demands), and initial factor endowments: $DEMAND:CONS D:PW Q:200 E:PL Q:(100*LENDOW) E:PK Q:100 $OFFTEXT * Instruct MPSGE to compile the functions: $SYSINCLUDE mpsgeset M1_1S * Use Labor as numeraire. (When no price is exogenously fixed, * the system uses one consumer income as normalization, and * this income level is determined by the initial price vector). PL.FX = 1; * Replicate the benchmark: M1_1S.ITERLIM = 0; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; M1_1S.ITERLIM = 2000; * Solve a counterfactual: 50% tax on inputs to X production. TX = 0.5; LENDOW = 1; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; * Solve a counterfactual: 100% increase in labor endowment (TX=0) TX = 0; LENDOW = 2; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; *------------------------------------------------------------------------- * Algebraic representation: * The equations are written using precisely the same variables * which have already been declared within the MPSGE model (hence * they need not be declared). EQUATIONS PRF_X Zero profit for sector X PRF_Y Zero profit for sector Y PRF_W Zero profit for sector W (Hicksian welfare index) MKT_X Supply-demand balance for commodity X MKT_Y Supply-demand balance for commodity Y MKT_L Supply-demand balance for primary factor L MKT_K Supply-demand balance for primary factor L MKT_W Supply-demand balance for aggregate demand I_CONS Income definition for CONS; * Zero profit conditions are produced for all of the production * sectors. These are interpreted as: * Cost of Production Gross of Tax = Value of Output PRF_X.. 100 * PL**0.4 * PK**0.6 * (1+TX) =E= 100 * PX; PRF_Y.. 100 * PL**0.6 * PK**0.4 =E= 100 * PY; PRF_W.. 200 * PX**0.5 * PY**0.5 =E= 200 * PW; * Market clearance conditions for each of the final goods and * primary factors. These are interpreted as: * Output plus Initial Endowment = Intermediate + Final Demand MKT_X.. 100 * X =E= 100 * W * PX**0.5 * PY**0.5 / PX; MKT_Y.. 100 * Y =E= 100 * W * PX**0.5 * PY**0.5 / PY; MKT_W.. 200 * W =E= CONS / PW; MKT_L.. 100 * LENDOW =E= 40 * X * PL**0.4 * PK**0.6 / PL + 60 * Y * PL**0.6 * PK**0.4 / PL; MKT_K.. 100 =E= 60 * X * PL**0.4 * PK**0.6 / PK + 40 * Y * PL**0.6 * PK**0.4 / PK; * Income balance states that the level of expenditure (CONS) * equals the value of factor income plus tax revenue: I_CONS.. CONS =E= 100*LENDOW*PL + 100*PK + TX*100*X*PL**0.4*PK**0.6; * We declare this model using the mixed complementarity syntax * in which equation identifiers are associated with variables. MODEL ALGEBRAIC /PRF_X.X, PRF_Y.Y, PRF_W.W, MKT_X.PX, MKT_Y.PY, MKT_L.PL, MKT_K.PK, MKT_W.PW, I_CONS.CONS /; * Check the benchmark: X.L=1; Y.L=1; W.L=1; PX.L=1; PY.L=1; PK.L=1; PW.L=1; CONS.L=200; TX = 0; LENDOW=1; ALGEBRAIC.ITERLIM = 0; SOLVE ALGEBRAIC USING MCP; ALGEBRAIC.ITERLIM = 2000; * Solve the same counterfactuals: (Note that if the PL is not * fixed, the algebraic model may not solve because the Jacobian * is singular at the solution) TX = 0.5; LENDOW = 1; SOLVE ALGEBRAIC USING MCP; TX = 0; LENDOW = 2; SOLVE ALGEBRAIC USING MCP; *--------------------------------------------------------------------- * EXERCISE (1): Remove the PL.FX = 1. * Rerun the counter-factual simulations using the MPSGE model and * the default price normalization. Verify that relative price in * the new solution are identical to the original solution. * Return to the default value of the lower and upper limit of PL: PL.LO = 0; PL.UP = +INF; * Check the benchmark: X.L=1; Y.L=1; W.L=1; PX.L=1; PY.L=1; PK.L=1; PW.L=1; CONS.L=200; TX = 0; LENDOW=1; M1_1S.ITERLIM = 0; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; M1_1S.ITERLIM = 2000; * Solve the same counterfactuals: TX = 0.5; LENDOW = 1; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; TX = 0; LENDOW = 2; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; *--------------------------------------------------------------------- * EXERCISE (2): Introduce a "typo" in sector X output, e.g. * O:PX Q:101, and then examine the benchmark replication * listing to see how this error is manifested in the output. * Specify a new value for X0: X0 = 101; * Return to the benchmark value of the parameters: TX = 0; LENDOW = 1; * Fix Labor as the numeraire: PL.FX = 1; DISPLAY X0; $INCLUDE M1_1S.GEN SOLVE M1_1S USING MCP; *------------------------------------------------------------------------- $TITLE Model M1_1V: Closed 2x2 Economy -- Introduces Vector Syntax * Declare the value of the variables as a table: TABLE BENCH(*,*) Benchmark financial flows (e.g. an input-output table) X Y W CONS X 100 -100 Y 100 -100 W 200 -200 L -40 -60 100 K -60 -40 100; * Declare the underlying sets: SET I Produced goods /X, Y/, F Factors of production /L, K/; * Use I and J to both index goods: ALIAS (I,J), (F,FF); PARAMETER Y0(I) Benchmark sectoral output, FD0(F,I) Benchmark factor demands, C0(I) Benchmark consumption demand, E(F) Factor endowments, T(I) Sectoral ad-valorem tax rate, W0 Benchmark total consumption; * Extract data from the original format into model-specific arrays: Y0(I) = BENCH(I,I); FD0(F,I) = -BENCH(F,I); C0(I) = -BENCH(I,"W"); W0 = SUM(I, C0(I)); E(F) = BENCH(F,"CONS"); T(I) = 0; DISPLAY Y0, FD0, C0, E, T; * MPSGE model declaration follows: $ONTEXT $MODEL:M1_1V * Here we define production activities over the set I. * N.B. If we are running the vector syntax model using the same * GMS file, the names of the variables must be different to those * used in the previous model (scalar syntax) because in this model * the domain is redefined. $SECTORS: OUT(I) ! Commodity production index W ! Welfare index $COMMODITIES: PW ! Utility price index PC(I) ! Commodity price index PF(F) ! Factor price index $CONSUMERS: CONS ! Representative consumer $PROD:OUT(I) s:1 O:PC(I) Q:Y0(I) I:PF(F) Q:FD0(F,I) A:CONS T:T(I) $PROD:W s:1 O:PW Q:W0 I:PC(I) Q:C0(I) $DEMAND:CONS D:PW Q:W0 E:PF(F) Q:E(F) $OFFTEXT $SYSINCLUDE mpsgeset M1_1V * Check the calibration: M1_1V.ITERLIM = 0; $INCLUDE M1_1V.GEN SOLVE M1_1V USING MCP; * Declare a GAMS parameter to hold the solution values: PARAMETER REPORT Summary report; * Extract solution values into this parameter: REPORT("WELFARE"," ","BENCH") = W.L; REPORT("PRICE",I,"BENCH") = PC.L(I); REPORT("PRICE",F,"BENCH") = PF.L(F); REPORT("OUTPUT",I,"BENCH") = OUT.L(I); M1_1V.ITERLIM = 2000; * Counterfactual: 50% tax on inputs to X production: T("X") = 0.5; $INCLUDE M1_1V.GEN SOLVE M1_1V USING MCP; REPORT("WELFARE"," ","50%TAX") = W.L; REPORT("PRICE",I,"50%TAX") = PC.L(I); REPORT("PRICE",F,"50%TAX") = PF.L(F); REPORT("OUTPUT",I,"50%TAX") = OUT.L(I); * Counterfactual: 100% increase in labor Endowment. Tax set back to zero: E("L") = 2 * E("L"); T(I) = 0; $INCLUDE M1_1V.GEN SOLVE M1_1V USING MCP; REPORT("WELFARE"," ","100%L") = W.L; REPORT("PRICE",I,"100%L") = PC.L(I); REPORT("PRICE",F,"100%L") = PF.L(F); REPORT("OUTPUT",I,"100%L") = OUT.L(I); * Place all the output at the bottom of the listing file: DISPLAY REPORT; *-------------------------------------------------------------------------- * Representation of the Algebraic Vector Syntax: PARAMETER ALPHA(F,I) Factor input benchmark value share BETA(I) Consumption value share; ALPHA(F,I) = FD0(F,I) / SUM(FF, FD0(FF,I)); BETA(I) = C0(I) / W0; EQUATIONS PROFIT(I) Zero profit condition CMKT(I) Commodity market clearance FMKT(F) Factor market clearance CPRF_W Zero profit for aggregate consumption CMKT_W Market clearance for aggregate consumption I_CON Income = factor earnings plus taxes; PROFIT(I).. (1+T(I)) * PROD(F, PF(F)**ALPHA(F,I)) =E= PC(I); CPRF_W.. PROD(I, PC(I)**BETA(I)) =E= PW; CMKT(I).. Y0(I) * OUT(I) =E= C0(I) * W * PROD(J, PC(J)**BETA(J)) / PC(I); CMKT_W.. W0 * W =E= CONS / PW; FMKT(F).. E(F) =E= SUM(I, FD0(F,I) * OUT(I) * PROD(FF, PF(FF)**ALPHA(FF,I))) / PF(F); I_CON.. CONS =E= SUM(F, PF(F) * E(F)) + SUM(I, T(I) * Y0(I) * OUT(I) * PROD(F, PF(F)**ALPHA(F,I)) ); MODEL ALGEBRAV /PROFIT.OUT, CPRF_W.W, CMKT.PC, FMKT.PF, CMKT_W.PW, I_CON.CONS/; SOLVE ALGEBRAV USING MCP;The solution listing appears as follows:
S O L V E S U M M A R Y MODEL M1_1S LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.000 +INF . ---- VAR Y . 1.000 +INF . ---- VAR W . 1.000 +INF . ---- VAR PX . 1.000 +INF . ---- VAR PY . 1.000 +INF . ---- VAR PL 1.000 1.000 1.000 EPS ---- VAR PK . 1.000 +INF . ---- VAR PW . 1.000 +INF . ---- VAR CONS . 200.000 +INF . X Activity level for sector X Y Activity level for sector Y W Activity level for sector W (Hicksian welfare index) PX Price index for commodity X PY Price index for commodity Y PL Price index for primary factor L PK Price index for primary factor K PW Price index for welfare (expenditure function) CONS Income level for consumer CONSCounterfactual model: 50% tax on inputs to X production
S O L V E S U M M A R Y MODEL M1_1S LOWER LEVEL UPPER MARGINAL ---- VAR X . 0.807 +INF . ---- VAR Y . 1.191 +INF . ---- VAR W . 0.981 +INF . ---- VAR PX . 1.430 +INF . ---- VAR PY . 0.968 +INF . ---- VAR PL 1.000 1.000 1.000 EPS ---- VAR PK . 0.923 +INF . ---- VAR PW . 1.177 +INF . ---- VAR CONS . 230.769 +INF .Counterfactual model: 100% increase in labor endowment (TX=0)
S O L V E S U M M A R Y MODEL M1_1S LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.320 +INF . ---- VAR Y . 1.516 +INF . ---- VAR W . 1.414 +INF . ---- VAR PX . 1.516 +INF . ---- VAR PY . 1.320 +INF . ---- VAR PL 1.000 1.000 1.000 EPS ---- VAR PK . 2.000 +INF . ---- VAR PW . 1.414 +INF . ---- VAR CONS . 400.000 +INF .Algebraic model
S O L V E S U M M A R Y MODEL ALGEBRAIC LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.000 +INF . ---- VAR Y . 1.000 +INF . ---- VAR W . 1.000 +INF . ---- VAR PX . 1.000 +INF . ---- VAR PY . 1.000 +INF . ---- VAR PL 1.000 1.000 1.000 EPS ---- VAR PK . 1.000 +INF . ---- VAR PW . 1.000 +INF . ---- VAR CONS . 200.000 +INF .Algebraic model- Counterfactual: 50% tax on inputs to X production
S O L V E S U M M A R Y MODEL ALGEBRAIC LOWER LEVEL UPPER MARGINAL ---- VAR X . 0.807 +INF . ---- VAR Y . 1.191 +INF . ---- VAR W . 0.981 +INF . ---- VAR PX . 1.430 +INF . ---- VAR PY . 0.968 +INF . ---- VAR PL 1.000 1.000 1.000 4.4400E-7 ---- VAR PK . 0.923 +INF . ---- VAR PW . 1.177 +INF . ---- VAR CONS . 230.769 +INF .Algebraic model- Counterfactual: 100% increase in labor endowment (TX=0)
S O L V E S U M M A R Y MODEL ALGEBRAIC LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.320 +INF . ---- VAR Y . 1.516 +INF . ---- VAR W . 1.414 +INF . ---- VAR PX . 1.516 +INF . ---- VAR PY . 1.320 +INF . ---- VAR PL 1.000 1.000 1.000 1.705E-13 ---- VAR PK . 2.000 +INF . ---- VAR PW . 1.414 +INF . ---- VAR CONS . 400.000 +INF .EXERCISE (1):Remove the PL.FX = 1 (use the default normalization)
S O L V E S U M M A R Y MODEL M1_1S Default price normalization using income for CONS LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.000 +INF . ---- VAR Y . 1.000 +INF . ---- VAR W . 1.000 +INF . ---- VAR PX . 1.000 +INF . ---- VAR PY . 1.000 +INF . ---- VAR PL . 1.000 +INF . ---- VAR PK . 1.000 +INF . ---- VAR PW . 1.000 +INF . ---- VAR CONS . 200.000 +INF .Counterfactual model: 50% tax on inputs to X production
S O L V E S U M M A R Y MODEL M1_1S Default price normalization using income for CONS LOWER LEVEL UPPER MARGINAL ---- VAR X . 0.807 +INF . ---- VAR Y . 1.191 +INF . ---- VAR W . 0.981 +INF . ---- VAR PX . 1.549 +INF . ---- VAR PY . 1.049 +INF . ---- VAR PL . 1.083 +INF . ---- VAR PK . 1.000 +INF . ---- VAR PW . 1.275 +INF . ---- VAR CONS . 250.000 +INF .Counterfactual model: 100% increase in labor endowment (TX=0)
S O L V E S U M M A R Y MODEL M1_1S Default price normalization using income for CONS LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.320 +INF . ---- VAR Y . 1.516 +INF . ---- VAR W . 1.414 +INF . ---- VAR PX . 1.200 +INF . ---- VAR PY . 1.045 +INF . ---- VAR PL . 0.792 +INF . ---- VAR PK . 1.583 +INF . ---- VAR PW . 1.120 +INF . ---- VAR CONS . 316.667 +INF .EXERCISE (2): Introduce a "typo" in sector X:
E x e c u t i o n ---- 991 PARAMETER X0 = 101.000 Benchmark value of X S O L V E S U M M A R Y MODEL M1_1S LOWER LEVEL UPPER MARGINAL ---- VAR X . 1.000 +INF . ---- VAR Y . 1.000 +INF . ---- VAR W . 1.005 +INF . ---- VAR PX . 0.990 +INF . ---- VAR PY . 1.000 +INF . ---- VAR PL 1.000 1.000 1.000 EPS ---- VAR PK . 1.000 +INF . ---- VAR PW . 0.995 +INF . ---- VAR CONS . 200.000 +INF .VECTOR SYNTAX
E x e c u t i o n ---- 1137 PARAMETER Y0 Benchmark sectoral output X 100.000, Y 100.000 ---- 1137 PARAMETER FD0 Benchmark factor demands X Y L 40.000 60.000 K 60.000 40.000 ---- 1137 PARAMETER C0 Benchmark consumption demand X 100.000, Y 100.000 ---- 1137 PARAMETER E Factor endowments L 100.000, K 100.000 ---- 1137 PARAMETER T Sectoral ad-valorem tax rate ( ALL 0.000 )Benchmark Replication
S O L V E S U M M A R Y MODEL M1_1V Default price normalization using income for CONS LOWER LEVEL UPPER MARGINAL ---- VAR W . 1.000 +INF . ---- VAR PW . 1.000 +INF . ---- VAR CONS . 200.000 +INF . ---- VAR OUT Commodity production index LOWER LEVEL UPPER MARGINAL X . 1.000 +INF . Y . 1.000 +INF . ---- VAR PC Commodity price index LOWER LEVEL UPPER MARGINAL X . 1.000 +INF . Y . 1.000 +INF . ---- VAR PF Factor price index LOWER LEVEL UPPER MARGINAL L . 1.000 +INF . K . 1.000 +INF .Counterfactual model: 50% increase in labor endowment (TX=0)
S O L V E S U M M A R Y MODEL M1_1V Default price normalization using income for CONS LOWER LEVEL UPPER MARGINAL ---- VAR W . 0.981 +INF . ---- VAR PW . 1.275 +INF . ---- VAR CONS . 250.000 +INF . ---- VAR OUT Commodity production index LOWER LEVEL UPPER MARGINAL X . 0.807 +INF . Y . 1.191 +INF . ---- VAR PC Commodity price index LOWER LEVEL UPPER MARGINAL X . 1.549 +INF . Y . 1.049 +INF . ---- VAR PF Factor price index LOWER LEVEL UPPER MARGINAL L . 1.083 +INF . K . 1.000 +INF .Counterfactual model: 100% increase in labor endowment (TX=0)
S O L V E S U M M A R Y MODEL M1_1V Default price normalization using income for CONS LOWER LEVEL UPPER MARGINAL ---- VAR W . 1.414 +INF . ---- VAR PW . 1.120 +INF . ---- VAR CONS . 316.667 +INF . ---- VAR OUT Commodity production index LOWER LEVEL UPPER MARGINAL X . 1.320 +INF . Y . 1.516 +INF . ---- VAR PC Commodity price index LOWER LEVEL UPPER MARGINAL X . 1.200 +INF . Y . 1.045 +INF . ---- VAR PF Factor price index LOWER LEVEL UPPER MARGINAL L . 0.792 +INF . K . 1.583 +INF .Summary of results from the Vector Syntax models:
E x e c u t i o n ---- 1599 PARAMETER REPORT Summary report BENCH 50%TAX 100%L WELFARE. 1.000 0.981 1.414 PRICE .X 1.000 1.549 1.200 PRICE .Y 1.000 1.049 1.045 PRICE .L 1.000 1.083 0.792 PRICE .K 1.000 1.000 1.583 OUTPUT .X 1.000 0.807 1.320 OUTPUT .Y 1.000 1.191 1.516VECTOR SYNTAX - Algebraic representation of the Vector Syntax.
S O L V E S U M M A R Y MODEL ALGEBRAV LOWER LEVEL UPPER MARGINAL ---- VAR W . 1.414 +INF . ---- VAR PW . 1.120 +INF . ---- VAR CONS . 316.667 +INF . ---- VAR OUT Commodity production index LOWER LEVEL UPPER MARGINAL X . 1.320 +INF . Y . 1.516 +INF . ---- VAR PC Commodity price index LOWER LEVEL UPPER MARGINAL X . 1.200 +INF . Y . 1.045 +INF . ---- VAR PF Factor price index LOWER LEVEL UPPER MARGINAL L . 0.792 +INF . K . 1.583 +INF .