Appendix. Core GAMS code for standard CGE model
SETS
AC global set for model accounts-aggregated microsam accounts
A(AC) activities
ACES(A) activities with CES fn at top of technology nest
ALEO(A) activities with Leontief fn at top of technology nest
C(AC) commodities
CD(C) commodities with domestic sales of output
CDN(C) commodities without domestic sales of output
CE(C) exported commodities
CEN(C) non-exported commodities
CM(C) imported commodities
CMN(C) non-imported commodities
CX(C) commodities with output
F(AC) factors
INS(AC) institutions
INSD(INS) domestic institutions
INSDNG(INSD) domestic non-government institutions
H(INSDNG) households
PARAMETERS
*Parameters other than tax rates
alphaa(A) shift parameter for top level CES function
alphaac(C) shift parameter for domestic commodity aggregation fn
alphaq(C) shift parameter for Armington function
alphat(C) shift parameter for CET function
alphava(A) shift parameter for CES activity production function
betah(A,C,H) marg shr of hhd cons on home com c from act a
betam(C,H) marg share of hhd cons on marketed commodity c
cwts(C) consumer price index weights
deltaa(A) share parameter for top level CES function
deltaac(A,C) share parameter for domestic commodity aggregation fn
deltaq(C) share parameter for Armington function
deltat(C) share parameter for CET function
deltava(F,A) share parameter for CES activity production function
dwts(C) domestic sales price weights
gammah(A,C,H) per-cap subsist cons for hhd h on home com c fr act a
gammam(C,H) per-cap subsist cons of market com c for hhd h
ica(C,A) intermediate input c per unit of aggregate intermediate
inta(A) aggregate intermediate input coefficient
iva(A) aggregate value added coefficient
icd(C,CP) trade input of c per unit of com cp produced & sold dom'ly
ice(C,CP) trade input of c per unit of com cp exported
icm(C,CP) trade input of c per unit of com cp imported
mps01(INS) 0-1 par for potential flexing of savings rates
mpsbar(INS) marg prop to save for dom non-gov inst ins (exog part)
qdst(C) inventory investment by sector of origin
qbarg(C) exogenous (unscaled) government demand
qbarinv(C) exogenous (unscaled) investment demand
rhoa(A) CES top level function exponent
rhoac(C) domestic commodity aggregation function exponent
rhoq(C) Armington function exponent
rhot(C) CET function exponent
rhova(A) CES activity production function exponent
shif(INS,F) share of dom. inst i in income of factor f
shii(INS,INSP) share of inst i in post-tax post-sav income of inst ip
supernum(H) LES supernumerary income
theta(A,C) yield of commodity c per unit of activity a
tins01(INS) 0-1 par for potential flexing of dir tax rates
trnsfr(INS,AC) transfers fr inst. or factor ac to institution ins
*Tax rates
ta(A) rate of tax on producer gross output value
te(C) rate of tax on exports
tf(F) rate of direct tax on factors (soc sec tax)
tinsbar(INS) rate of (exog part of) direct tax on dom inst ins
tm(C) rate of import tariff
tq(C) rate of sales tax
tva(A) rate of value-added tax
VARIABLES
CPI consumer price index (PQ-based)
DPI index for domestic producer prices (PDS-based)
DMPS change in marginal propensity to save for selected inst
DTINS change in domestic institution tax share
EG total current government expenditure
EH(H) household consumption expenditure
EXR exchange rate
FSAV foreign savings
GADJ government demand scaling factor
GOVSHR govt consumption share of absorption
GSAV government savings
IADJ investment scaling factor (for fixed capital formation)
INVSHR investment share of absorption
MPS(INS) marginal propensity to save for dom non-gov inst ins
MPSADJ savings rate scaling factor
PA(A) output price of activity a
PDD(C) demand price for com c produced & sold domestically
PDS(C) supply price for com c produced & sold domestically
PE(C) price of exports
PINTA(A) price of intermediate aggregate
PM(C) price of imports
PQ(C) price of composite good c
PVA(A) value added price
PWE(C) world price of exports
PWM(C) world price of imports
PX(C) average output price
PXAC(A,C) price of commodity c from activity a
QA(A) level of domestic activity
QD(C) quantity of domestic sales
QE(C) quantity of exports
QF(F,A) quantity demanded of factor f from activity a
QFS(F) quantity of factor supply
QG(C) quantity of government consumption
QH(C,H) quantity consumed of marketed commodity c by household h
QHA(A,C,H) quantity consumed of home commodity c fr act a by hhd h
QINT(C,A) quantity of intermediate demand for c from activity a
QINTA(A) quantity of aggregate intermediate input
QINV(C) quantity of fixed investment demand
QM(C) quantity of imports
QQ(C) quantity of composite goods supply
QT(C) quantity of trade and transport demand for commodity c
QVA(A) quantity of aggregate value added
QX(C) quantity of aggregate marketed commodity output
QXAC(A,C) quantity of ouput of commodity c from activity a
TABS total absorption
TINS(INS) rate of direct tax on domestic institutions ins
TINSADJ direct tax scaling factor
TRII(INS,INSP) transfers to dom inst insdng from insdngp
WALRAS savings-investment imbalance (should be zero)
WF(F) economy-wide wage (rent) for factor f
WFDIST(F,A) factor wage distortion variable
YF(F) factor income
YG total current government income
YIF(INS,F) income of institution ins from factor f
YI(INS) income of (domestic non-governmental) institution ins
EQUATIONS
*Price block===============================================
PMDEF(C) domestic import price
PEDEF(C) domestic export price
PDDDEF(C) demand price for com c produced and sold domestically
PQDEF(C) value of sales in domestic market
PXDEF(C) value of marketed domestic output
PADEF(A) output price for activity a
PINTADEF(A) price of aggregate intermediate input
PVADEF(A) value-added price
CPIDEF consumer price index
DPIDEF domestic producer price index
*Production and trade block================================
CESAGGPRD(A) CES aggregate prod fn (if CES top nest)
CESAGGFOC(A) CES aggregate first-order condition (if CES top nest)
LEOAGGINT(A) Leontief aggreg intermed demand (if Leontief top nest)
LEOAGGVA(A) Leontief aggreg value-added demand (if Leontief top nest)
CESVAPRD(A) CES value-added production function
CESVAFOC(F,A) CES value-added first-order condition
INTDEM(C,A) intermediate demand for commodity c from activity a
COMPRDFN(A,C) production function for commodity c and activity a
OUTAGGFN(C) output aggregation function
OUTAGGFOC(A,C) first-order condition for output aggregation function
CET(C) CET function
CET2(C) domestic sales and exports for outputs without both
ESUPPLY(C) export supply
ARMINGTON(C) composite commodity aggregation function
COSTMIN(C) first-order condition for composite commodity cost min
ARMINGTON2(C) comp supply for com without both dom sales and imports
QTDEM(C) demand for transactions (trade and transport) services
*Institution block ========================================
YFDEF(F) factor incomes
YIFDEF(INS,F) factor incomes to domestic institutions
YIDEF(INS) total incomes of domest non-gov't institutions
EHDEF(H) household consumption expenditures
TRIIDEF(INS,INSP) transfers to inst ins from inst insp
HMDEM(C,H) LES cons demand by hhd h for marketed commodity c
HADEM(A,C,H) LES cons demand by hhd h for home commodity c fr act a
INVDEM(C) fixed investment demand
GOVDEM(C) government consumption demand
EGDEF total government expenditures
YGDEF total government income
*System constraint block===================================
COMEQUIL(C) composite commodity market equilibrium
FACEQUIL(F) factor market equilibrium
CURACCBAL current-account balance (of RoW)
GOVBAL government balance
TINSDEF(INS) direct tax rate for inst ins
MPSDEF(INS) marg prop to save for inst ins
SAVINVBAL savings-investment balance
TABSEQ total absorption
INVABEQ investment share in absorption
GDABEQ government consumption share in absorption
*Notational convention inside equations:
*Parameters and "invariably" fixed variables are in lower case.
*Potentially "variable" variables are in upper case.
*Price block===============================================
PMDEF(C)$CM(C)..
PM(C) =E= pwm(C)*(1 + tm(C))*EXR + SUM(CT, PQ(CT)*icm(CT,C));
PEDEF(C)$CE(C)..
PE(C) =E= pwe(C)*(1 - te(C))*EXR - SUM(CT, PQ(CT)*ice(CT,C));
PDDDEF(C)$CD(C).. PDD(C) =E= PDS(C) + SUM(CT, PQ(CT)*icd(CT,C));
PQDEF(C)$(CD(C) OR CM(C))..
PQ(C)*(1 - tq(c))*QQ(C) =E= PDD(C)*QD(C) + PM(C)*QM(C);
PXDEF(C)$CX(C).. PX(C)*QX(C) =E= PDS(C)*QD(C) + PE(C)*QE(C);
PADEF(A).. PA(A) =E= SUM(C, PXAC(A,C)*theta(A,C));
PINTADEF(A).. PINTA(A) =E= SUM(C, PQ(C)*ica(C,A)) ;
PVADEF(A).. PA(A)*(1-ta(A))*QA(A) =E= PVA(A)*QVA(A) + PINTA(A)*QINTA(A) ;
CPIDEF.. CPI =E= SUM(C, cwts(C)*PQ(C)) ;
DPIDEF.. DPI =E= SUM(CD, dwts(CD)*PDS(CD)) ;
*Production and trade block================================
*CESAGGPRD and CESAGGFOC apply to activities with CES function at
*top of technology nest.
CESAGGPRD(A)$ACES(A)..
QA(A) =E= alphaa(A)*(deltaa(A)*QVA(A)**(-rhoa(A))
+ (1-deltaa(A))*QINTA(A)**(-rhoa(A)))**(-1/rhoa(A)) ;
CESAGGFOC(A)$ACES(A)..
QVA(A) =E= QINTA(A)*((PINTA(A)/PVA(A))*(deltaa(A)/
(1 - deltaa(A))))**(1/(1+rhoa(A))) ;
*LEOAGGINT and LEOAGGVA apply to activities with Leontief function at
*top of technology nest.
LEOAGGINT(A)$ALEO(A).. QINTA(A) =E= inta(A)*QA(A) ;
LEOAGGVA(A)$ALEO(A).. QVA(A) =E= iva(A)*QA(A) ;
*CESVAPRD, CESVAFOC, INTDEM apply at the bottom of the technology nest
*(for all activities).
CESVAPRD(A)..
QVA(A) =E= alphava(A)*(SUM(F,
deltava(F,A)*QF(F,A)**(-rhova(A))) )**(-1/rhova(A)) ;
CESVAFOC(F,A)$deltava(F,A)..
WF(F)*wfdist(F,A) =E=
PVA(A)*(1-tva(A))
* QVA(A) * SUM(FP, deltava(FP,A)*QF(FP,A)**(-rhova(A)) )**(-1)
*deltava(F,A)*QF(F,A)**(-rhova(A)-1);
INTDEM(C,A)$ica(C,A).. QINT(C,A) =E= ica(C,A)*QINTA(A);
COMPRDFN(A,C)$theta(A,C)..
QXAC(A,C) + SUM(H, QHA(A,C,H)) =E= theta(A,C)*QA(A) ;
OUTAGGFN(C)$CX(C)..
QX(C) =E= alphaac(C)*SUM(A, deltaac(A,C)*QXAC(A,C)
**(-rhoac(C)))**(-1/rhoac(C));
OUTAGGFOC(A,C)$deltaac(A,C)..
PXAC(A,C) =E=
PX(C)
* QX(C) * SUM(AP, deltaac(AP,C)*QXAC(AP,C)**(-rhoac(C)) )**(-1)
*deltaac(A,C)*QXAC(A,C)**(-rhoac(C)-1);
CET(C)$(CE(C) AND CD(C))..
QX(C) =E= alphat(C)*(deltat(C)*QE(C)**rhot(C) +
(1 - deltat(C))*QD(C)**rhot(C))**(1/rhot(C)) ;
ESUPPLY(C)$(CE(C) AND CD(C))..
QE(C) =E= QD(C)*((PE(C)/PDS(C))*
((1 - deltat(C))/deltat(C)))**(1/(rhot(C)-1)) ;
CET2(C)$( (CD(C) AND CEN(C)) OR (CE(C) AND CDN(C)) )..
QX(C) =E= QD(C) + QE(C);
ARMINGTON(C)$(CM(C) AND CD(C))..
QQ(C) =E= alphaq(C)*(deltaq(C)*QM(C)**(-rhoq(C)) +
(1 -deltaq(C))*QD(C)**(-rhoq(C)))**(-1/rhoq(C)) ;
COSTMIN(C)$(CM(C) AND CD(C))..
QM(C) =E= QD(C)*((PDD(C)/PM(C))*(deltaq(C)/(1 - deltaq(C))))
**(1/(1 + rhoq(C)));
ARMINGTON2(C)$( (CD(C) AND CMN(C)) OR (CM(C) AND CDN(C)) )..
QQ(C) =E= QD(C) + QM(C);
QTDEM(C)$CT(C)..
QT(C) =E= SUM(CP, icm(C,CP)*QM(CP) + ice(C,CP)*QE(CP) + icd(C,CP)*QD(CP));
*Institution block ========================================
YFDEF(F).. YF(F) =E= SUM(A, WF(F)*wfdist(F,A)*QF(F,A));
YIFDEF(INSD,F)$shif(INSD,F)..
YIF(INSD,F) =E= shif(INSD,F)*((1-tf(f))*YF(F) - trnsfr('ROW',F)*EXR);
YIDEF(INSDNG)..
YI(INSDNG) =E=
SUM(F, YIF(INSDNG,F)) + SUM(INSDNGP, TRII(INSDNG,INSDNGP))
+ trnsfr(INSDNG,'GOV')*CPI + trnsfr(INSDNG,'ROW')*EXR;
TRIIDEF(INSDNG,INSDNGP)$(shii(INSDNG,INSDNGP))..
TRII(INSDNG,INSDNGP) =E= shii(INSDNG,INSDNGP)
* (1 - MPS(INSDNGP)) * (1 - TINS(INSDNGP))* YI(INSDNGP);
EHDEF(H)..
EH(H) =E= (1 - SUM(INSDNG, shii(INSDNG,H))) * (1 - MPS(H))
* (1 - TINS(H)) * YI(H);
HMDEM(C,H)$betam(C,H)..
PQ(C)*QH(C,H) =E=
PQ(C)*gammam(C,H)
+ betam(C,H)*( EH(H) - SUM(CP, PQ(CP)*gammam(CP,H))
- SUM((A,CP), PXAC(A,CP)*gammah(A,CP,H))) ;
HADEM(A,C,H)$betah(A,C,H)..
PXAC(A,C)*QHA(A,C,H) =E=
PXAC(A,C)*gammah(A,C,H)
+ betah(A,C,H)*(EH(H) - SUM(CP, PQ(CP)*gammam(CP,H))
- SUM((AP,CP), PXAC(AP,CP)*gammah(AP,CP,H))) ;
INVDEM(C).. QINV(C) =E= IADJ*qbarinv(C);
GOVDEM(C).. QG(C) =E= GADJ*qbarg(C);
YGDEF..
YG =E= SUM(INSDNG, TINS(INSDNG)*YI(INSDNG))
+ SUM(f, tf(F)*YF(F))
+ SUM(A, tva(A)*PVA(A)*QVA(A))
+ SUM(A, ta(A)*PA(A)*QA(A))
+ SUM(C, tm(C)*pwm(C)*QM(C))*EXR
+ SUM(C, te(C)*pwe(C)*QE(C))*EXR
+ SUM(C, tq(C)*PQ(C)*QQ(C))
+ SUM(F, YIF('GOV',F))
+ trnsfr('GOV','ROW')*EXR;
EGDEF.. EG =E= SUM(C, PQ(C)*QG(C)) + SUM(INSD, trnsfr(INSD,'GOV'))*CPI;
*System constraint block===================================
FACEQUIL(F).. SUM(A, QF(F,A)) =E= QFS(F);
COMEQUIL(C)..
QQ(C) =E= SUM(A, QINT(C,A)) + SUM(H, QH(C,H)) + QG(C)
+ QINV(C) + qdst(C) + QT(C);
CURACCBAL..
SUM(C, pwm(C)*QM(C)) + SUM(F, trnsfr('ROW',F)) =E=
SUM(C, pwe(C)*QE(C)) + SUM(INSD, trnsfr(INSD,'ROW')) + FSAV;
GOVBAL.. YG =E= EG + GSAV;
TINSDEF(INSDNG)..
TINS(INSDNG) =E= tinsbar(INSDNG)*(1 + TINSADJ*tins01(INSDNG)) + DTINS*tins01(INSDNG);
MPSDEF(INSDNG)..
MPS(INSDNG) =E= mpsbar(INSDNG)*(1 + MPSADJ*mps01(INSDNG)) + DMPS*mps01(INSDNG);
SAVINVBAL..
SUM(INSDNG, MPS(INSDNG) * (1 - TINS(INSDNG)) * YI(INSDNG))
+ GSAV + FSAV*EXR =E=
SUM(C, PQ(C)*QINV(C)) + SUM(C, PQ(C)*qdst(C)) + WALRAS;
TABSEQ..
TABS =E=
SUM((C,H), PQ(C)*QH(C,H)) + SUM((A,C,H), PXAC(A,C)*QHA(A,C,H))
+ SUM(C, PQ(C)*QG(C)) + SUM(C, PQ(C)*QINV(C)) + SUM(C, PQ(C)*qdst(C));
INVABEQ.. INVSHR*TABS =E= SUM(C, PQ(C)*QINV(C)) + SUM(C, PQ(C)*qdst(C));
GDABEQ.. GOVSHR*TABS =E= SUM(C, PQ(C)*QG(C));