$TITLE M8-2.GMS: Small open economy 2x2 * contrasts tariffs versus (iceberg) trade costs $ONTEXT CALIBRATION: country exports X1, imports X2 in free-trade benchmark Production Sectors Consumer Markets | X1 X2 E1 M2 W CONS ---------------------------------------------------------------- P1 | 150 -50 -100 P2 | 50 50 -100 PL | -135 -5 140 PK | -15 -45 60 PW | 200 -200 PFX | 50 -50 ---------------------------------------------------------------- $OFFTEXT * the first four parameters allow changes in (exogenous) world PARAMETERS PE2 Export price of good 2 /0.999/ PM1 Import price of good 1 /1.001/ PE1 Export price of good 1 /1/ PM2 Import price of good 2 /1/ TR Import tariff (gross basis) /1/ TC Trade costs (gross basis) /1/ CONSX1 Consumption of X1 CONSX2 Consumption of X2; NONNEGATIVE VARIABLES X1 Activity level for sector X1 X2 Activity level for sector X2 E1 Activity level for sector E1 E2 Activity level for sector E2 M1 Activity level for sector M1 M2 Activity level for sector M2 W Activity level for sector W P1 Price index for commodity X P2 Price index for commodity Y PL Price index for primary factor L PK Price index for primary factor K PW Price index for welfare (consumer price index) PFX Real exchange rate index CONS Income definition for CONS; EQUATIONS PRF_X1 Zero profit for sector X1 PRF_X2 Zero profit for sector X2 PRF_E1 Zero profit for sector E1 PRF_E2 Zero profit for sector E2 PRF_M1 Zero profit for sector M1 PRF_M2 Zero profit for sector M2 PRF_W Zero profit for sector W MKT_X1 Supply-demand balance for commodity X1 MKT_X2 Supply-demand balance for commodity X2 MKT_PFX Supply-demand balance for commodity PFX 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 PRF_X1.. 150*PL**(0.9) * PK**(0.1) =G= 150*P1; PRF_X2.. 50*PL**(0.1) * PK**(0.9) =G= 50*P2; PRF_E1.. 50*P1 =G= 50*PFX*PE1; PRF_E2.. 50*P2 =G= 50*PFX*PE2; PRF_M1.. 50*PFX*PM1*TC*TR =G= 50*P1; PRF_M2.. 50*PFX*PM2*TC*TR =G= 50*P2; PRF_W.. 100*P1**0.5 * P2**0.5 =G= 100*PW; * Market clearance conditions MKT_X1.. 150*X1 + 50*M1/TC =G= 50*E1 + 100*W*PW/P1; MKT_X2.. 50*X2 + 50*M2/TC =G= 50*E2 + 100*W*PW/P2 ; MKT_PFX.. 50*E2*PE2 + 50*E1*PE1 =G= 50*PM2*M2 + 50*PM1*M1; MKT_W.. 200*W =G= CONS / PW; MKT_L.. 140 =G= 135*X1 * P1/PL + 5*X2*P2/PL; MKT_K.. 60 =G= 15*X1*P1/PK + 45*X2*P2/PK; * Income balance I_CONS.. CONS =E= 140*PL + 60*PK + 50*PFX*PM2*(TR-1)* M2; MODEL SOE /PRF_X1.X1, PRF_X2.X2, PRF_E1.E1, PRF_E2.E2, PRF_M1.M1, PRF_M2.M2, PRF_W.W, MKT_X1.P1, MKT_X2.P2, MKT_PFX.PFX, MKT_L.PL, MKT_K.PK, MKT_W.PW, I_CONS.CONS /; * set benchmark values: X1.L =1; X2.L =1; E2.L =0; M1.L =0; E1.L =1; M2.L =1; W.L =1; P1.L =1; P2.L =1; PFX.L =1; PK.L =1; PL.L =1; CONS.L =200; * choose the real consumer price index as numeraire PW.FX =1; * check for calibration and starting-value errors SOE.ITERLIM = 0; SOLVE SOE USING MCP; SOE.ITERLIM = 2000; SOLVE SOE USING MCP; * SHOW HOW TO DO MULTIPLE SCENARIOS * SHOW DIFFERENCE BETWEEN TARIFF AND TRADE COST OF EQUAL RATES SETS I indexes 25 different gross cost levels /I1*I25/ J indexes 2 scenarios: 1 = tariff 2 = trade cost /J1*J2/; PARAMETERS RATE(I) WELFARE(I,J) IMP2(I,J) TRATE(I,J) TCOST(I,J) RESULTS(I, *); LOOP(J, LOOP(I, TC = 1; TR = 1; RATE(I) = 1 + .05*ORD(I) - 0.05; TR$(ORD(J) EQ 1) = RATE(I); TC$(ORD(J) EQ 2) = RATE(I); SOLVE SOE USING MCP; WELFARE(I,J) = W.L; IMP2(I,J) = M2.L/TC; ); ); RESULTS(I, "RATE") = RATE(I); RESULTS(I, "WELTR") = WELFARE(I, "J1"); RESULTS(I, "WELTC") = WELFARE(I, "J2"); RESULTS(I, "IMP2TR")= IMP2(I,"J1"); RESULTS(I, "IMP2TC")= IMP2(I,"J2"); DISPLAY RESULTS; * Write parameter RESULTS to an Excel file M8.XLS, * starting in Sheet1 Execute_Unload 'M8.gdx' RESULTS execute 'gdxxrw.exe M8.gdx par=RESULTS rng=SHEET1!' * simpler but less sophisticated dump to excel $LIBINCLUDE XLDUMP RESULTS M8.XLS SHEET2!