* This is a general version of the example 6* TABLE BENCH (*,*) Benchmark financial flows 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 YO(I) Benchmark sectoral output, FDO(F,I) Benchmark factor demands, CO(I) Benchmark consumption demand, E(F) Factor endowments, T(I) Sectoral ad-valorem tax rate, WO Benchmark total consumption; *Extract data from the table: YO(I) = BENCH (I,I); FDO(F,I) = -BENCH (F,I); CO(I) = -BENCH (I,"W"); WO = SUM (I,CO(I)); E(F) = BENCH (F,"CONS"); T(I) = 0; DISPLAY YO, FDO, CO, E, T, WO; *MPSGE model declaration follows: $ONTEXT *Change the model name, because 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. $MODEL:M1_1V $SECTORS: Y(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:Y(I) s:1 O:PC(I) Q:YO(I) I:PF(F) Q:FDO(F,I) A:CONS T:T(I) $PROD:W s:1 O:PW Q:WO I:PC(I) Q:CO(I) $DEMAND:CONS D:PW Q:WO 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; M1_1V.ITERLIM = 2000; *Use labor as the numeraire commodity: PF.FX("L") = 1; *Declare a GAMS parameter to hold the solution values: PARAMETER REPORT Summary report; REPORT("WELFARE"," ","BENCH") = W.L; REPORT("PRICE", I, "BENCH") = PC.L(I); REPORT("PRICE", F, "BENCH") = PF.L(F); REPORT("OUTPUT", I, "BENCH") = Y.L(I); *Solve some counterfactuals: *(1) 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") = Y.L(I); *(2) 100% increase in labor Ement, 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") = Y.L(I); *Place all the output at the bottom of the listing file: DISPLAY REPORT; *Present the algebraic syntax: PARAMETER ALPHA(F,I) Factor input consumption value share BETA(I) Consumption value share; ALPHA(F,I) = FDO(F,I) / SUM(FF, FDO(FF,I)); BETA(I) = CO(I) / WO; EQUATIONS PROFIT(I) Zero profit condition CMKT(I) Commodity market clearance FMKT(F) Factor market clearance PRF_W Zero profit for aggregate consumption MKT_W Market clearance for aggregate consumption I_CONS Income = factor earnings plus taxes; PROFIT(I).. (1+T(I)) * PROD(F, PF(F)**ALPHA(F,I)) =E= PC(I); PRF_W.. PROD(I, PC(I)**BETA(I)) =E= PW; CMKT(I).. YO(I) * Y(I) =E= CO(I) * W * PROD(J, PC(J)**BETA(J)) / PC(I); MKT_W.. WO * W =E= CONS / PW; FMKT(F).. E(F) =E= SUM(I, FDO(F,I) * Y(I) * PROD(FF, PF(FF)**ALPHA(FF,I))) / PF(F); I_CONS.. CONS =E= SUM(F, PF(F) * E(F)) + SUM(I, T(I) * YO(I) * PROD(F, PF(F)**ALPHA(F,I))); MODEL ALGEBRAIC /PROFIT.Y, PRF_W.W, CMKT.PC, FMKT.PF, MKT_W.PW, I_CONS.CONS/; SOLVE ALGEBRAIC USING MCP;