Description
Sample Program Comparing GAMS/MCP and GAMS/MPSGE Formulations This program contains two presentations of an open-economy general equilibrium model. The first employs MILES/MCP for a model expressed with equations written in standard GAMS algebra. The second version of the model is expressed with MPSGE tables. The equations for the MPSGE version are generated automatically. Both model formulations illustrate the manner in which Armington and Heckscher-Ohlin imports can be mixed in the same model. Solution values for this sample dataset are intuitive. Exemptions reduce the "economic burden" of the tax, but they may also completely contradict the stated purpose of the energy tax (i.e., with tax exemptions to energy-intensive industry, energy demand may go up rather than down).
Small Model of Types : MPSGE mcp
Category : GAMS Model library
Main file : sammge.gms
$title Carbon Taxes with Exemptions for Heavy Industry (SAMMGE,SEQ=151)
$onText
Sample Program Comparing GAMS/MCP and GAMS/MPSGE Formulations
This program contains two presentations of an open-economy general
equilibrium model. The first employs MILES/MCP for a model expressed
with equations written in standard GAMS algebra. The second version
of the model is expressed with MPSGE tables. The equations for the
MPSGE version are generated automatically.
Both model formulations illustrate the manner in which Armington
and Heckscher-Ohlin imports can be mixed in the same model.
Solution values for this sample dataset are intuitive. Exemptions
reduce the "economic burden" of the tax, but they may also completely
contradict the stated purpose of the energy tax (i.e., with tax
exemptions to energy-intensive industry, energy demand may go up
rather than down).
Boehringer, C, and Rutherford, T R, Carbon taxes with exemptions in an
open economy: A general equilibrium analysis of the German tax
initiative. Journal of Environmental Economics and Management 32 (2)
(1997), 189-203.
---- 1134 PARAMETER REPORT SUMMARY REPORT (%)
NON-EXEMPT NON-EXEMPT EXEMPT EXEMPT
MCP MGE MCP MGE
WELFARE.T10 -0.2 -0.2
WELFARE.T25 -0.3 -0.3 -0.2 -0.2
WELFARE.T50 -0.5 -0.5 -0.5 -0.5
ENERGY .T05 -13.2 -13.2 1.4 1.4
ENERGY .T10 -25.6 -25.6 2.8 2.8
ENERGY .T25 -30.7 -30.7 7.4 7.4
ENERGY .T50 -36.9 -36.9 10.1 10.1
Keywords: mixed complementarity problem, general equilibrium model, tax policy,
carbon taxes, GAMS - MPSGE framework, HeckscherOhlin model
$offText
Set
G 'commodities' / X, Y, E /
F 'primary factors' / K, L, R /
SC 'tax scenarios' / T05, T10, T25, T50 /
NE(G) 'non-energy goods' / X, Y /
ARM(G) 'Armington imports';
Alias (S,G), (FF,F);
Scalar GAMMA 'energy-other good elasticity' / 0.5 /;
Parameter
ZBAR(S) 'benchmark output'
DBAR(G,S) 'benchmark intermediate input'
FDBAR(F,S) 'benchmark factor input'
MNET(G) 'net imports'
XNET(G) 'net exports'
MGROSS(G) 'gross imports'
XGROSS(G) 'gross exports'
CBAR(G) 'benchmark final consumption'
UBAR 'benchmark expenditure'
ENDOW(F) 'factor endowments'
T(G,S) 'input tax rate'
TC(G) 'consumption tax'
ESUBM(G) 'Armington elasticities (+inf = Heckscher-Ohlin)' / E inf, X inf, Y 4 /
TAXLEVEL(SC) 'tax rates' / T05 0.05, T10 0.10, T25 0.25, T50 0.5 /;
Table SAM(*,*) 'benchmark social accounts'
X Y E EXPORT IMPORT DEMAND
X 20 -10 -4 2 -8
Y 105 -20 13 -98
E -4 -5 5 9 -5
K -10 -40 -1 51
L -6 -50 56
R -4 4
FX 24 -24 ;
* EXTRACT THE DATA:
ZBAR(S) = SAM(S,S);
DBAR(G,S) = max(0, -SAM(G,S));
FDBAR(F,S) = -SAM(F,S);
XGROSS(G) = -SAM(G,"EXPORT");
MGROSS(G) = SAM(G,"IMPORT");
MNET(G) = max(0, MGROSS(G) - XGROSS(G));
XNET(G) = max(0, XGROSS(G) - MGROSS(G));
CBAR(G) = -SAM(G,"DEMAND");
UBAR = sum(G, CBAR(G));
ENDOW(F) = SAM(F,"DEMAND");
* LOAD IDENTIFIERS FOR IMPORTED GOODS, EXPORTED GOODS AND
* ACTIVE PRIMARY FACTORS:
ARM(G) = yes$(ESUBM(G) < +inf);
abort$(smin(G$ARM(G), MGROSS(G)) = 0)
" CANNOT CALIBRATE ARMINGTON DEMAND WHEN IMPORT SHARE IS ZERO!", ARM, MGROSS;
Positive Variable
Z(S) 'sectoral output index'
A(G) 'supply index'
M(G) 'import index'
X(G) 'export index'
U 'utility index'
PFX 'price of foreign exchange'
P(G) 'goods price index'
C(G) 'production cost index'
W(F) 'factor price index'
PU 'utility price'
RA 'representative agent income';
Equation
PRF_Z(S) 'zero profit for domestic production'
PRF_A(S) 'supply profit'
PRF_M(G) 'zero profit for imports'
PRF_X(G) 'zero profit for exports'
PRF_U 'zero profit for consumption'
MKT_PFX 'market clearance in foreign exchange'
MKT_P(G) 'market clearance in goods supply'
MKT_C(G) 'market clearance in domestic output'
MKT_W(F) 'market clearance in factors'
MKT_PU 'market clearance in aggregate demand'
DEF_RA 'definition of RA';
* DEFINE THE MODEL ASSOCIATING EQUATIONS WITH VARIABLES.
Model ENERGY / PRF_Z.Z, PRF_M.M, PRF_X.X, PRF_U.U, MKT_PFX.PFX, MKT_P.P
MKT_W.W, MKT_PU.PU, PRF_A.A, MKT_C.C, DEF_RA.RA /;
* SHARE PARAMETERS REQUIRE FOR THE ALGEBRAIC FORMULATION:
Parameter
ALPHA(G,S) 'value share for good G in sector S'
ALPHAF(S) 'value share of primary factors in sector S'
THETA(F,S) 'share of factor F in sector S value added'
ALPHAN 'value share of non-energy inputs'
ALPHAE 'value share of energy inputs'
BETA(G) 'value share of good G in non-energy inputs'
ALPHAM 'import share of aggregate domestic demand';
ALPHA(G,S) = DBAR(G,S)/ZBAR(S);
ALPHAF(S) = sum(F, FDBAR(F,S))/ZBAR(S);
THETA(F,S) = FDBAR(F,S)/sum(FF, FDBAR(FF,S));
ALPHAN = sum(NE, CBAR(NE))/UBAR;
ALPHAE = 1 - ALPHAN;
BETA(NE) = CBAR(NE)/sum(G$NE(G), CBAR(G));
ALPHAM(S) = (MGROSS(S)/(ZBAR(S) + MGROSS(S)))$ARM(S);
* THIS CONSTRAINT ESTABLISHES A BALANCE BETWEEN INPUT PRICES
* AND THE COST OF PRODUCTION:
PRF_Z(S)..
(sum(G, ALPHA(G,S)*(P(G)*(1 + T(G,S)))**(1 - GAMMA)) +
ALPHAF(S)*(prod(F, W(F)**THETA(F,S)))**(1 - GAMMA) )**(1/(1 - GAMMA)) =g= C(S);
* THIS CONSTRAINT RELATES THE COST OF SUPPLY TO THE MARKET
* SALES PRICE. WHEN IMPORTS ARE PERFECT SUBSTITUTES, COST
* OF PRODUCTION MUST BE NO LESS THAN SALES PRICE:
PRF_A(S)..
C(S)$(not ARM(S)) + (((1 - ALPHAM(S))*C(S)**(1 - ESUBM(S))
+ ALPHAM(S)*PFX**(1 - ESUBM(S)))**(1/(1 - ESUBM(S))))$ARM(S)
=g= P(S);
* WHEN IMPORTS ARE PERFECT SUBSTITUTES, THE DOMESTIC PRICE MUST BE
* NO HIGHER THAN THE IMPORT PRICE:
PRF_M(G)$(not ARM(G))..
PFX =g= P(G);
* ARBITRAGE THROUGH EXPORTS KEEPS THE DOMESTIC PRICE ABOVE THE
* INTERNATIONAL PRICE:
PRF_X(G)..
C(G) =g= PFX;
* THE COST OF A UNIT OF UTILITY DEPENDS ON ENERGY AND NON-
* ENERGY PRICES:
PRF_U..
(ALPHAE*(P("E")*(1 + TC("E")))**(1 - GAMMA) +
ALPHAN*(prod(NE, P(NE)**BETA(NE)))**(1 - GAMMA) )**(1/(1 - GAMMA)) =g= PU;
* FOREIGN EXCHANGE MARKETS:
MKT_PFX..
sum(G, X(G)) =g= sum(G, M(G)$(not ARM(G)) + (MGROSS(G)*A(G)*(P(G)/PFX)**ESUBM(G))$ARM(G));
* FACTOR MARKETS:
MKT_W(F)..
ENDOW(F) =g= sum(S, Z(S)*FDBAR(F,S)*(P(S)/prod(FF, W(FF)**THETA(FF,S)))**GAMMA
*prod(FF, W(FF)**THETA(FF,S))/W(F));
* DOMESTIC OUTPUT IS EITHER SUPPLIED TO THE DOMESTIC MARKET
* OR IT IS EXPORTED. THE DOMESTIC MARKET DEMAND IS PRICE
* RESPONSIVE IF (ESUBM(G) < +INF):
MKT_C(S)..
ZBAR(S)*Z(S) =g= ((ZBAR(S) - XNET(S))*A(S) + X(S))$(not ARM(S))
+ ((ZBAR(S) - XGROSS(S))*A(S)*(P(S)/C(S))**ESUBM(S) + X(S))$ARM(S);
* SUPPLY-DEMAND BALANCE. THIS EQUATION INCLUDES THE IMPORT
* ACTIVITY WHEN IMPORTS ARE PERFECT SUBSTITUTES, OTHERWISE
* DOMESTIC AND IMPORTED SUPPLIES ENTER AS A COMPOSITE GOOD THE
* QUANTITY OF WHICH IS SCALED BY A.
MKT_P(G)..
(A(G)*(ZBAR(G) - XNET(G)) + M(G) )$(not ARM(G)) +
(A(G)*(ZBAR(G) - XGROSS(G) + MGROSS(G)))$ARM(G) =g=
sum(S, Z(S)*DBAR(G,S)*(P(S)/(P(G)*(1+T(G,S))))**GAMMA) +
U*CBAR(G)*(((PU/(P(G)*(1+TC(G))))**GAMMA)$(not NE(G)) +
((PU/prod(NE, P(NE)**BETA(NE)))**GAMMA*
(prod(NE, P(NE)**BETA(NE))/P(G)))$NE(G));
* THE VALUE OF COMPOSITE CONSUMPTION GOOD SUPPLY MUST EXHAUST
* INCOME:
MKT_PU..
U*UBAR =g= RA*UBAR/PU;
DEF_RA..
RA*UBAR =e= sum(F, W(F)*ENDOW(F)) + U*P("E")*TC("E")*CBAR("E")
* (PU/(P("E")*(1 + TC("E"))))**GAMMA
+ sum(S, Z(S)*P("E")*T("E",S)*DBAR("E",S)*(C(S)/(P("E")*(1 + T("E",S))))**GAMMA);
* BENCHMARK REPLICATION FOR H_O MODEL:
Z.l(S) = 1; A.l(S) = 1; U.l = 1; C.l(G) = 1;
W.l(F) = 1; PU.l = 1; PFX.l = 1; RA.l = 1;
T(G,S) = 0; TC(G) = 0; P.l(G) = 1;
M.l(G)$(not ARM(G)) = MNET(G);
X.l(G)$(not ARM(G)) = XNET(G);
X.l(G)$ARM(G) = XGROSS(G);
M.fx(G)$ARM(G) = 0;
* NORMALIZE PRICES USING INCOME:
RA.fx = 1;
T(G,S) = 0;
TC(G) = 0;
ENERGY.iterLim = 0;
solve ENERGY using mcp;
ENERGY.iterLim = 2000;
ARM(G) = yes$(ESUBM(G) < +inf);
M.l(G)$(not ARM(G)) = MNET(G);
X.l(G)$(not ARM(G)) = XNET(G);
X.l(G)$ARM(G) = XGROSS(G);
M.up(G) = +inf;
M.fx(G)$ARM(G) = 0;
X.up(G) = +inf;
Parameter REPORT 'summary report (%)';
* COMPUTE THE COUNTER-FACTUAL SCENARIOS:
loop(SC,
* FIRST SOLVE FOR THE EQUILIBRIUM WITHOUT EXEMPTIONS:
T("E",S) = TAXLEVEL(SC);
TC("E") = TAXLEVEL(SC);
solve ENERGY using mcp;
REPORT("WELFARE",SC,"NON-EXEMPT","MCP") = round(100*(U.l-1), 1);
REPORT("ENERGY",SC,"NON-EXEMPT","MCP") = round(100*(
(A.l("E")*(ZBAR("E") - XNET("E")) + M.l("E"))/
(ZBAR("E") + MNET("E") - XNET("E")) - 1), 1);
* THEN, EXEMPT SECTOR X FROM THE TAX:
T("E","X") = 0;
solve ENERGY using mcp;
REPORT("WELFARE",SC,"EXEMPT","MCP") = round(100*(U.l-1), 1);
REPORT("ENERGY",SC, "EXEMPT","MCP") = round(100*(
(A.l("E")*(ZBAR("E") - XNET("E")) + M.l("E"))/
(ZBAR("E") + MNET("E") - XNET("E")) - 1), 1);
);
* NEXT, WE HAVE THE MPSGE FORMULATION OF THE SAME MODEL:
$onText
$MODEL:GEMODEL
$SECTORS:
Z(S) ! SECTORAL OUTPUT INDEX
A(S) ! ARMINGTON SUPPLY
M(G) ! IMPORT INDEX
X(G) ! EXPORT INDEX
U ! UTILITY INDEX
$COMMODITIES:
PFX ! PRICE OF FOREIGN EXCHANGE
P(G) ! GOODS PRICE INDEX
C(G) ! COST INDEX
W(F) ! FACTOR PRICE INDEX
PU ! UTILITY PRICE
$CONSUMERS:
RA ! REPRESENTATIVE AGENT INCOME
* DOMESTIC PRODUCTION: NESTED CES AGGREGATE OF GOODS AND PRIMARY
* FACTOR INPUTS:
$PROD:Z(S) s:GAMMA a:1
O:C(S) Q:ZBAR(S)
I:P(G) Q:DBAR(G,S) A:RA T:T(G,S)
I:W(F) Q:FDBAR(F,S) a:
* ARMINGTON MODEL: IMPORTS AND DOMESTIC OUTPUT ENTER
* THROUGH A CES FUNCTION:
$PROD:A(S)$ARM(S) s:ESUBM(S)
O:P(S) Q:(ZBAR(S) - XGROSS(S) + MGROSS(S))
I:C(S) Q:(ZBAR(S) - XGROSS(S))
I:PFX Q:MGROSS(S)
* HECKSCHER-OHLIN MODEL: DOMESTIC AND IMPORTED GOODS ARE
* PERFECT SUBSTITUTES, SUPPLIED EITHER FROM A() OR M():
$PROD:A(S)$(NOT ARM(S))
O:P(S) Q:(ZBAR(S) - XNET(S))
I:C(S) Q:(ZBAR(S) - XNET(S))
$PROD:M(G)
O:P(G) Q:1
I:PFX Q:1
* BOTH VERSIONS OF THIS MODEL TREAT EXPORTS AS PERFECT
* SUBSTITUTES FOR DOMESITIC PRODUCTS:
$PROD:X(G)
O:PFX Q:1
I:C(G) Q:1
* UTILITY AGGREGATE NESTS NON-ENERGY GOODS IN a:
$PROD:U s:GAMMA a:1
O:PU Q:(sum(G, CBAR(G)))
I:P(G) Q:CBAR(G) A:RA T:TC(G) a:$NE(G)
* THE REPRESENTATIVE AGENT HAS FACTOR ENDOWMENTS AND SPENDS
* MONEY ON THE AGGREGATE CONSUMPTION GOOD:
$DEMAND:RA
D:PU Q:(sum(G, CBAR(G)))
E:W(F) Q:ENDOW(F)
$offText
* READ THE "HEADER FILE" WHICH IS AUTOMATICALLY PRODUCED BY
* THE MPSGE PRE-PROCESSOR:
$sysInclude mpsgeset GEMODEL
* NORMALIZE PRICES USING INCOME:
RA.fx = UBAR;
* INSTALL ACTIVITY LEVELS FOR IMPORTS AND EXPORTS:
ARM(G) = yes$(ESUBM(G) < +inf);
M.L(G)$(not ARM(G)) = MNET(G);
X.L(G)$(not ARM(G)) = XNET(G);
X.L(G)$ARM(G) = XGROSS(G);
M.UP(G) = +inf;
M.FX(G)$ARM(G) = 0;
X.UP(G) = +inf;
* CHECK THE BENCHMARK CALIBRATION:
T(G,S) = 0;
TC(G) = 0;
GEMODEL.iterLim = 0;
* GENERATE THE MODEL BY EXECUTING THE MODEL GENERATION FILE:
$include GEMODEL.GEN
solve GEMODEL using mcp;
GEMODEL.iterLim = 2000;
loop(SC,
* FIRST SOLVE FOR THE EQUILIBRIUM WITHOUT EXEMPTIONS:
T("E",S) = TAXLEVEL(SC);
TC("E") = TAXLEVEL(SC);
$ include GEMODEL.GEN
solve GEMODEL using mcp;
REPORT("WELFARE",SC,"NON-EXEMPT","MGE") = round(100*(U.l-1), 1);
REPORT("ENERGY",SC,"NON-EXEMPT","MGE") = round(100*(
(A.l("E")*(ZBAR("E") - XNET("E")) + M.l("E"))/
(ZBAR("E") + MNET("E") - XNET("E")) - 1), 1);
* THEN, EXEMPT SECTOR X FROM THE TAX:
T("E","X") = 0;
$ include GEMODEL.GEN
solve GEMODEL using mcp;
REPORT("WELFARE",SC,"EXEMPT","MGE") = round(100*(U.l-1), 1);
REPORT("ENERGY",SC, "EXEMPT","MGE") = round(100*(
(A.l("E")*(ZBAR("E") - XNET("E")) + M.l("E"))/
(ZBAR("E") + MNET("E") - XNET("E")) - 1), 1);
);
option REPORT:1:2:2;
display REPORT;