$ontext
E Fadali modify WSU model to do NV water footprints JUly 13, 2013
water switched over to consumption rather than withdrawals
incorporation of water taxes
now trying unit water tax
Regional CGE Model
2004 Stodick- Holland- and Devadoss Based on model by Lofgren
for version with water as factor in competitive market
SAM modified to add water factor - water'rents' read in from Excel
********************************************************************************
PROGPATH is the folder where REPORT.GMS and LOOP3.GMS programs are located.*
********************************************************************************
$offtext
$clear
$SETGLOBAL PROGPATH M:\H799\cge_footprint\NewHollandAttempts\
$ONSYMXREF
$ontext
********************************************************************************
Structure of the aggregated SAM
A C F INST T(FT) T(DT)
1 2 3 4 5 6
A 1 MAKE
C 2 USE IUSE CEXPRT CEXPRT
F 3 FD FEXPRT FEXPRT
INST 4 IMAKE FS TRNSFR IEXPRT IEXPRT
T(FT) 5 CIMPRT FIMPRT IIMPRT TRNSHP TRNSHP
T(DT) 6 CIMPRT FIMPRT IIMPRT TRNSHP TRNSHP
$offtext
SET K Aggregated Accounts /
* Activities
HAY-A All other crop farming
LIVESTOCK-A Livestock
DAIRY-A Dairy
VEGMEL-A Vegetable and melon farming
AGR-A Agriculture
MIN-A Other Mining
METMIN-A Metal Mining
ELEC-A Electricity
TU-A Transport Gas Info
WATER-A Water Utility
CONST-A Construction Except Resid
RESID-A Construction of New Resid
WTR_FRE-A Hi Water Finance Real Estate
FOODPROC-A Food Processing
MFG-A Manufacturing
TRADE-A Retail and wholesale trade
SER-A Services
HEALTH-A Healthcare
REC-A Recreation
FOODRINK-A Food and drinking places
* Commodities
HAY-C All other crop farming
LIVESTOCK-C Livestock
DAIRY-C Dairy
VEGMEL-C Vegetable and melon farming
AGR-C Agriculture
MIN-C Other Mining
METMIN-C Metal Mining
ELEC-C Electricity
TU-C Transport Gas Info
WATER-C Water Utility
CONST-C Construction Except Resid
RESID-C Construction of New Resid
WTR_FRE-C Hi Water Finance Real Estate
FOODPROC-C Food Processing
MFG-C Manufacturing
TRADE-C Retail and wholesale trade
SER-C Services
HEALTH-C Healthcare
REC-C Recreation
FOODRINK-C Food and drinking places
* Factors
LAB Employee Compensation
CAP Proprietary Income
WATER Returns to water factor
INDT Indirect Business Taxes
* Institutions
HHL Low-income HH
HHM Medium-income HH
HHH High-income HH
FGOV Federal Govt
SGOV State Local Govt
INV Investment
* Trading Regions
FT Foreign Trade
DT Domestic Trade
* Total
TOTAL Total
* Difference of column total and row total
DIFF Difference
/;
SET AI(K) trying to make superset for this waterdata
* AI(K) = A(K) + IN(K);
/ HAY-A All other crop farming
LIVESTOCK-A Livestock
DAIRY-A Dairy
VEGMEL-A Vegetable and melon farming
AGR-A Agriculture
MIN-A Other Mining
METMIN-A Metal Mining
ELEC-A Electricity
TU-A Transport Gas Info
WATER-A Water Utility
CONST-A Construction Except Resid
RESID-A Construction of New Resid
WTR_FRE-A Hi Water Finance Real Estate
FOODPROC-A Food Processing
MFG-A Manufacturing
TRADE-A Retail and wholesale trade
SER-A Services
HEALTH-A Healthcare
REC-A Recreation
FOODRINK-A Food and drinking places
HHL Low-income HH
HHM Medium-income HH
HHH High-income HH
FGOV Federal Govt
SGOV State Local Govt
INV Investment
FT Foreign Trade
DT Domestic Trade/;
SET A(AI) Activities /
HAY-A All other crop farming
LIVESTOCK-A Livestock
DAIRY-A Dairy
VEGMEL-A Vegetable and melon farming
AGR-A Agriculture
MIN-A Other Mining
METMIN-A Metal Mining
ELEC-A Electricity
TU-A Transport Gas Info
WATER-A Water Utility
CONST-A Construction Except Resid
RESID-A Construction of New Resid
WTR_FRE-A Hi Water Finance Real Estate
FOODPROC-A Food Processing
MFG-A Manufacturing
TRADE-A Retail and wholesale trade
SER-A Services
HEALTH-A Healthcare
REC-A Recreation
FOODRINK-A Food and drinking places
/;
SET ANWU(A) set of all activities except water utility /
HAY-A All other crop farming
LIVESTOCK-A Livestock
DAIRY-A Dairy
VEGMEL-A Vegetable and melon farming
AGR-A Agriculture
MIN-A Other Mining
METMIN-A Metal Mining
ELEC-A Electricity
TU-A Transport Gas Info
CONST-A Construction Except Resid
RESID-A Construction of New Resid
WTR_FRE-A Hi Water Finance Real Estate
FOODPROC-A Food Processing
MFG-A Manufacturing
TRADE-A Retail and wholesale trade
SER-A Services
HEALTH-A Healthcare
REC-A Recreation
FOODRINK-A Food and drinking places
/;
SET WU(A) set with water utility only /
WATER-A Water Utility /;
SET AW(A) Activities using water as factor of production
/ HAY-A All other crop farming
LIVESTOCK-A Livestock
DAIRY-A Dairy
VEGMEL-A Vegetable and melon farming
AGR-A Agriculture
MIN-A Other Mining
METMIN-A Metal Mining
ELEC-A Electricity
WATER-A Water Utility
FOODPROC-A Food Processing
MFG-A Manufacturing /;
SET ANW(A) Activities not using water as factor of production
/ TU-A Transport Gas Info
CONST-A Construction Except Resid
RESID-A Construction of New Resid
WTR_FRE-A Hi Water Finance Real Estate
TRADE-A Retail and wholesale trade
SER-A Services
HEALTH-A Healthcare
REC-A Recreation
FOODRINK-A Food and drinking places /;
SET AG(A) agricultural sectors
/HAY-A All other crop farming
LIVESTOCK-A Livestock
DAIRY-A Dairy
VEGMEL-A Vegetable and melon farming
AGR-A Agriculture / ;
SET NAG(A) nonagricultural sectors;
NAG(A)=A(A)-AG(A);
SET C(K) Commodities /
HAY-C All other crop farming
LIVESTOCK-C Livestock
DAIRY-C Dairy
VEGMEL-C Vegetable and melon farming
AGR-C Agriculture
MIN-C Other Mining
METMIN-C Metal Mining
ELEC-C Electricity
TU-C Transport Gas Info
WATER-C Water Utility
CONST-C Construction Except Resid
RESID-C Construction of New Resid
WTR_FRE-C Hi Water Finance Real Estate
FOODPROC-C Food Processing
MFG-C Manufacturing
TRADE-C Retail and wholesale trade
SER-C Services
HEALTH-C Healthcare
REC-C Recreation
FOODRINK-C Food and drinking places
/;
SET AGC(C) Ag commodities/
HAY-C All other crop farming
LIVESTOCK-C Livestock
DAIRY-C Dairy
VEGMEL-C Vegetable and melon farming
AGR-C Agriculture/;
SET F(K) Factors /
LAB Employee Compensation
CAP Proprietary Income
WATER Returns to water factor
INDT Indirect Business Taxes /;
*real set of factors
SET FF(F) Production Factors
/LAB Employee Compensation
WATER Returns to water factor
CAP Proprietary Income/;
SET FNW(FF) Production Factors without water
/LAB Employee Compensation
CAP Proprietary Income/;
SET IN(AI) All final demands
/HHL Low-income HH
HHM Medium-income HH
HHH High-income HH
FGOV Federal Govt
SGOV State Local Govt
INV Investment
FT Foreign Trade
DT Domestic Trade/;
SET I(IN) Institutions /
HHL Low-income HH
HHM Medium-income HH
HHH High-income HH
FGOV Federal Govt
SGOV State Local Govt
INV Investment /;
SET G(I) Government units
/FGOV Federal Govt
SGOV State Local Govt/;
SET H(I) Households
/HHL
HHM
HHH/;
SET HG(I) Households and Government units;
HG(I) = H(I) + G(I);
SET T(IN) Trade /
FT Foreign Trade
DT Domestic Trade /;
ALIAS (FF,FFF),(C,CC),(H,HH),(A,AA),(T,TT),(K,KK),(G,GG),(FNW,FFNW);
SET DFT(K) differences and totals rows and columns
/TOTAL Total
DIFF Difference /;
SET J(K) SAM index without totals and diff row and column ;
J(K)=K(K)-DFT(K);
ALIAS (J,JJ);
PARAMETER SAM(K,KK) Aggregated SAM;
*sets for water data
SET EW just to read in employment and water data
/TREATED initial use of utility provided water
RAWWATER raw water use (AF) by sector from adapted Blackhurst n USGS
CONVERT ratio to convert water withdrawal to consumption /;
SET WT types of water
/RAW self supplied water from water rights ownership
TREAT supplied by water utility
TOTAL self supply plus treated/;
SET HW just to read in no of households by income group
/2010HH no of households by income group/;
SET EM just to read in employment data
/EMPLOY employment /;
SET CONV just to read in conversion data for commodities
/CONV conversion rate for commodities /;
*southern nevada data
*WATDAT is Excel file being read in
*$CALL GDXXRW.EXE WATDATreadclark.xls par=WATDATCL rng=a1:d29
*Parameter WATDATCL(AI,EW);
*$GDXIN WATDATreadclark.gdx
*$LOAD WATDATCL
*$GDXIN
*Nevada data
$CALL GDXXRW.EXE WATDATread2.xls par=WATDAT2 rng=a1:d29
Parameter WATDAT2(AI,EW);
$GDXIN WATDATread2.gdx
$LOAD WATDAT2
$GDXIN
*needed conversion rates to apply to commodity and couldn't find a shorter route
*WATDATcomm is Excel file being read in
$CALL GDXXRW.EXE WATDATcomm.xls par=WATDATC rng=a1:b21
Parameter WATDATC(C,CONV);
$GDXIN WATDATcomm.gdx
$LOAD WATDATC
$GDXIN
*EMPLOY is Excel file being read in
*$CALL GDXXRW.EXE EMPLOYclark.xls par=EMPLOYCL rng=a1:b21
*Parameter EMPLOYCL(A,EM);
*$GDXIN EMPLOYclark.gdx
*$LOAD EMPLOYCL
*$GDXIN
*HHNUM1 is Excel file being read in
*$CALL GDXXRW.EXE HHNUMREADclark.xls par=HHNUMCL rng=a1:b4
*Parameter HHNUMCL(H,HW);
*$GDXIN HHNUMREADclark.gdx
*$LOAD HHNUMCL
*$GDXIN
*display WATDATCL,EMPLOYCL, HHNUMCL;
*EMPLOY1 is Excel file being read in
$CALL GDXXRW.EXE EMPLOYREAD.xls par=EMPLOY1 rng=a1:b21
Parameter EMPLOY1(A,EM);
$GDXIN EMPLOYREAD.gdx
$LOAD EMPLOY1
$GDXIN
*HHNUM1 is Excel file being read in
$CALL GDXXRW.EXE HHNUMREAD.xls par=HHNUM1 rng=a1:b4
Parameter HHNUM1(H,HW);
$GDXIN HHNUMREAD.gdx
$LOAD HHNUM1
$GDXIN
display WATDAT2,EMPLOY1, HHNUM1;
PARAMETERS
WATERo(AI,WT) Initial water use in AF by type
CONVERT(AI) Sector conversion rate withdrawal to consumption
EMPLOY(A) Employment data
HHNUM(H) Number of households by income group;
WATERo(AI,"TREAT") = WATDAT2(AI,"TREATED");
WATERo(AI,"RAW") = WATDAT2(AI,"RAWWATER");
*had issues with employment and conversion being wrong sector data -doublecheck
CONVERT(AI) = WATDAT2(AI,"CONVERT");
EMPLOY(A) = EMPLOY1(A,"EMPLOY");
HHNUM(H) = HHNUM1(H,"2010HH");
$ontext
WATERo(AI,"TREAT") = WATDATCL(AI,"TREATED");
WATERo(AI,"RAW") = WATDATCL(AI,"RAWWATER");
*had issues with employment and conversion being wrong sector data -doublecheck
CONVERT(AI) = WATDATCL(AI,"CONVERT");
EMPLOY(A) = EMPLOYCL(A,"EMPLOY");
HHNUM(H) = HHNUMCL(H,"2010HH");
$offtext
WATERo(AI,"TOTAL") = WATERo(AI,"TREAT")+WATERo(AI,"RAW");
*Water intensity data from exogenous Blackhurst method and 2006 IMPLAN 2005 USGS
*will be used for IMPLAN project with IO
*these are now withdrawals(not consumption)
*simplest to say withdrawals are "at source"
*for footprints consumption is better
display WATERo,CONVERT,EMPLOY;
* I need them to pay for water withdrawn but calculate their footprint with
*water consumed
*WATERo(AI,WT)=CONVERT(AI)*WATERo(AI,WT);
*note here that if I want to increase sectors will need to redo area that is
*to be read in
*BALSAMtoReadIn6 or 7 is SAM in Excel file being read in
*$CALL GDXXRW.EXE BALSAMClark5high.xls par=SAM2 rng=a1:bb55
$CALL GDXXRW.EXE BALSAMtoReadIn7.xls par=SAM2 rng=a1:bb55
Parameter SAM2(K,KK);
$GDXIN BALSAMtoReadIn7.gdx
*$GDXIN BALSAMClark5high.gdx
$LOAD SAM2
$GDXIN
display SAM2;
SAM(K,KK)=SAM2(K,KK);
display SAM;
Parameter tbshr(G) Government unit share of indirect business taxes ;
tbshr(G) = SAM(G,'INDT')/SUM(GG,SAM(GG,'INDT'));
display tbshr;
*do both withdrawals and consumption
*can go back and forth with the USGS factors
PARAMETER WATERTOTo(WT) initial total activity water use in AF;
WATERTOTo(WT) = SUM(A,WATERo(A,WT));
display WATERTOTo;
*the 'endogenous' water intensity factors
PARAMETERS
WAT_INTENSo(A,WT) initial water intensity AF per million dollar;
WAT_INTENSo(A,WT) = WATERo(A,WT)/SAM("TOTAL",A);
display WAT_INTENSo ;
PARAMETER
trwaterunit AF of treated water per million $ of water utility commodity;
trwaterunit = WATERo('WATER-A','RAW')/SAM('WATER-C',"TOTAL");
display trwaterunit;
$ontext
In order to use water as a factor of production with this method I assume
water is 'rented' just as are all other factors and I find some portion of returns
to capital to assign to water rents. Ideally this would be by using 'real' water
rents, i.e. annualized water rights sale prices.
$offtext
* Parameters set by user
PARAMETERS
CAPCLOS Capital closure
LABCLOS Labor closure
WATCLOS Water closure
SICLOS Savings investment closure
ROWCLOS Foreign savings closure
RUSCLOS RUS savings closure
xed(C,T) Elasticity of demand for world export function
esubp(A) Elasticity of substitution for factors of production
esubkl(A) Elasticity of substitution between capital and labor
esubklw(A) Elasticity of substitution between cap-labor aggreg and water
esubd(C) Elasticity of substitution (armington) between regional output and imports
esubs(C) Elasticity of transformation between regional production and foreign export
esube(C) Elasticity of transformation between row and rus for exports
esubm(C) Elasticity of substitution (armington) between row imports and rus imports
*Some income elasticities are not possible given an LES demand
*ine must be positive - not possible to have inferior goods
ine(C,H) Income elasticity
*frisch parameter is the negative of the inverse supernumerary ratio
frisch(H) elasticity of marginal utility of total expenditure
* frisch(C) Consumption flexibility--determines minimum subsistence level of consumption -1 imples zero minimum
*frisch parameter is ratio of total expenditure to "supernumerary income"
*that is, the 'disposable' income left after purchasing all subsistence mins
*it relates to the closures
efac(FF) demand (supply?)elasticity for capital and labor and water;
esubd(C) = 2.0;
esubs(C) = 2.5;
esube(C) = 2;
esubm(C) = 1.5;
*difficult to import or export water except at border - for NV this shouldn't
*be significant
esubd('WATER-C') = 0.5;
esubs('WATER-C') = 0.5;
esube('WATER-C') = 0.5;
esubm('WATER-C') = 0.5;
*any other 'non-tradeables'
esubd('RESID-C') = 0.5;
esubs('RESID-C') = 0.5;
esube('RESID-C') = 0.5;
esubm('RESID-C') = 0.5;
$ontext
esubd('LIVESTOCK-C') = 4.0;
esubs('LIVESTOCK-C') = 2.5;
esube('LIVESTOCK-C') = 2;
esubm('LIVESTOCK-C') = 2;
esubd('AGR-C') = 4.0;
esubs('AGR-C') = 2.5;
esube('AGR-C') = 2;
esubm('AGR-C') = 2;
$offtext
ine(C,'HHL') = 0.99;
ine(C,'HHM') = 0.98;
ine(C,'HHH') = 0.95;
*
ine('FOODPROC-C','HHL') = 0.33;
ine('VEGMEL-C','HHL') = 1.1;
ine('TRADE-C','HHL') = 0.55;
ine('ELEC-C','HHL') = 0.52;
ine('SER-C','HHL') = 1.4;
ine('MFG-C','HHL') = 1.5;
*$ontext
ine('FOODPROC-C','HHM') = 0.33;
ine('VEGMEL-C','HHM') = 1.1;
ine('TRADE-C','HHM') = 0.55;
ine('ELEC-C','HHM') = 0.52;
ine('SER-C','HHM') = 1.4;
ine('MFG-C','HHM') = 1.5;
ine('FOODPROC-C','HHH') = 0.33;
ine('VEGMEL-C','HHH') = 1.1;
ine('TRADE-C','HHH') = 0.55;
ine('ELEC-C','HHH') = 0.52;
ine('SER-C','HHH') = 1.4;
ine('MFG-C','HHH') = 1.45;
*$offtext
*most sectors not aggregated in such a way that other elasticities given in DRAM
*can be said to be applicable
*I used information from an MIT paper about nonhomothetic demands to get an
*approximate value for the frisch parameter - they had a value for entire econ-
*omy though.
frisch('HHL') = -1.5;
frisch('HHM') = -1.5;
frisch('HHH') = -1.5;
efac('CAP') = 2.0;
efac('LAB') = 0.8;
* efac('WATER') = 0.3;
efac('WATER') = 0.1;
* Set closure options here
*capital is immobile over the short term
CAPCLOS = 3;
* if CAPCLOS = 1, capital is mobile and supply is fixed
* if CAPCLOS = 2, capital is mobile and supply is variable
* if CAPCLOS = 3, capital is activity specific and fixed
LABCLOS =3;
* if LABCLOS = 1, labor is mobile and supply is fixed
* if LABCLOS = 2, labor is mobile and supply is variable
* if LABCLOS = 3, labor is mobile. Unemployment is possible.
WATCLOS = 1;
* if WATCLOS = 1, water is mobile and supply is fixed
* if WATCLOS = 2, water is mobile across ag sectors only supply is fixed
* if WATCLOS = 3, water is activity specific and fixed
SICLOS =2;
* if SICLOS = 1, savings is investment driven
* if SICLOS = 2, savings drives investment
* if SICLOS = 3, CPI changes. (keynesian closure if wage is fixed?)
* if SICLOS = 4, borrowing ( QIINV) adjusts
* if SICLOS = 5, investment adjusts using a demand function derived from a Stone-Geary utility function
* savings drives investment. Commodity investment varies with price.
* if SICLOS = 6, investment adjusts using a demand function derived from a Stone-Geary utility function
* investment drives savings. Commodity investment varies with price.
ROWCLOS =3;
* if ROWCLOS = 1, exchange rate is variable
* if ROWCLOS = 2, foreign savings (export - FSAVX) is variable
* if ROWCLOS = 3, foreign savings (import - FSAVM) is variable
RUSCLOS = 2;
* if RUSCLOS = 1, RUS exchange rate is variable
* if RUSCLOS = 2, RUS savings (export - DSAVX) is variable
* if RUSCLOS = 3, RUS savings (import - DSAVM) is variable
$ontext
in this version I'm choosing SICLOS = 1 and getting rid of CPI - CPI =1
savings is investment driven
choosing rowclos and rusclos =2 so that exchange rate is held constant =1
foreign savings (export - FSAVX) is variable
RUS savings (export - DSAVX) is variable
Note that if there is any kind of welfare measurement comparison going on
these closures for savings and investment and trade are problematic for one
period models since borrowing is costless and improves welfare effects but only
comes due in later periods
$offtext
* Set parameters here
xed(C,T) = -50;
esubp(A) = 0.7;
* esubp(AW) = 0.2;
*no longer really need below since I have special production function for water
*utility
esubp(WU) = 0.2;
SCALAR sgovbal State government budget balance;
PARAMETERS
PMO(C) Initial import price (domestic currency)
XRO(T) Initial exchange rate
PEO(C) Initial export price (domestic currency)
PQO(C) Initial composite commodity price
PDO(C) Initial domestic price of domestic output
QQO(C) Initial quantity supplied to domestic commodity demanders
QMO(C) Initial quantity of imports
QDO(C) Initial quantity of domestic output sold domestically
PXO(C) Initial producer price
QXO(C) Initial quantity of domestic output
QEO(C) Initial quantity of exports
PAO(A) Initial activity price
PVAO(ANWU) Initial value added price
PVAWO(WU) Initial price for labor capital composite
QAO(A) Initial activity level
QFO(FF,A) Initial quantity demanded of factor FF by activity A
SUMQFO(FF) trying to troubleshoot a division by zero error
QFKLO(A) Initial quantity demanded of labor-capital composite by activity A
QINTO(C,A) Initial quantity of intermeditate use of commodity C by activity A
WFO(FF) Initial average wage or rental rate of factor FF
YFO(I,FF) Initial transfer of income to institution I from factor FF
YHO(H) Initial gross household income
NYHO(H) Initial net household income
QHO(C,H) Initial household comsumption
QINVO(C) Initial investment demand
QIINVO(I) Initial institutional investment
YFGO Initial federal government revenue
EFGO Initial federal government expenditures
YSGO Initial state government revenue
ESGO Initial state government expenditures
QFSO(FF) Initial factor supply
FSAVXO Initial exports foreign savings
DSAVXO Initial exports RUS savings
WFDISTO(FF,A) Initial distortion factor for factor FF in activity A
INDTO(G) Initial indirect taxes
IMAKEQO(I,C) Initial institutional make matrix (quantity)
QMRO(T,C) Initial regional imports
PMRO(T,C) Initial regional import price
QERO(C,T) Initial regional exports
PERO(C,T) Initial regional export price
PWEO(C,T) Initial world export price
IADJO Initial investment adjustment factor
IIADJO Initial institutional investment adjustment factor
IADJSGO1(C) Initial investment equation variable
IADJSGO2(C) Initial Stone-Geary adjustment variable
SADJO Initial savings adjustment factor
SGADJO Initial state government adjustment factor for quantity purchased
SHIFTFFO(FF) Factor supply equation shift variable
FGOVBALO Initial Federal budget surpus or deficit
FIMPRTO(T,FF) Initial factors called imports
GTRNSFRO(H,G) INitial govt transfers to households
TRNSFRO(G,GG) Initial intergovernmental transfers
HEXPRTO(H,T) Initial household receipts from outside of region sources
GEXPRTO(G,T) Initial govt receipts from outside of region sources
HIMPRTO(T,H) Initial household imports
GIMPRTO(T,G) Initial govt imports
GDPO initial GDP dummy for maximization
CHECKGDP tryiing to figure out what is going on with gdp
;
PARAMETERS
theta(A,C) Yield of output C per unit of activity A
ica(C,A) Quantity of C as intermediate input per unit of activity A
wica Quantity of water factor per unit of (water util sector)
wicashare initial share of outlay to water factor
vashare(A) initial share of outlay to value added factors
vasharew initial share of outlay to labor and capital factors only
ad(A) Production shift parameter
adw Production shift parameter for water utility prod fctn
akl(A) Production shift parameter in capital labor nest
aklw(A) production shift parameter in water cap-labor aggreg nest
del(FF,A) Production function share parameter
delw(FNW) Production function share parameter for water utility
kldel(A) production function share parameter capital labor nest
klwdel(A) production function share parameter water cap-labor aggreg nest
rho(A) CES production function exponent
klrho(A) CES production function exponent capital labor nest
klwrho(A) CES production function exponent water cap-labor aggreg nest
adel(C) Armington commodity composite share parameter for production
aq(C) Armington commodity composite shift parameter
arho(C) Armington commodity composite exponent
sdel(C) Armington CET composite share parameter for domestic sales
srho(C) Armington CET composite exponent
as(C) Armington CET composite shift parameter
edel(C) Armington composite share parameter foreign exports
erho(C) Armington composite exponent for exports
ae(C) Armington composite shift parameter for exports
mdel(C) Armington composite share parameter foreign imports
mrho(C) Armington composite exponent for imports
am(C) Armington composite shift parameter for imports
tc(C) Consumption tax (only paid by households)
tu(C) unit tax on consumption
tq(C) Sales tax
tqs(C) Sales tax on services not previously taxed
tm(T,C) Import taxes
te(C,T) Export tax rate
tb(A) Indirect business tax rate
tbnew(C,A) using as an inter demand tax rate in simulations
tf(FF,A) Ad valorem tax rate on factor use
tuf(FF,A) unit tax on factor use
mps(H) Marginal propensity to save
ty(G,H) Rate of household income tax
trh(H,HH) Interhousehold transfers
pwm(T,C) ROW and RUS import price
cwts(C) weight of commodity C in the cpi
CPIO initial consumer price index
wfa(FF,A) wage for factor FF in activity A
xshift(C,T) Shift parameter for world export demand function
*need a subsistence level for food consumption
lambda(C,H) Subsistance level parameter
beta(C,H) Marginal budget share parameter
* ine has restrictions implied by budget constraint- for example not every
*good can be a luxury good so greater proportion demanded of everything
*all at once if income increases
engelwt(H) Engel aggregation weight
qg(C,G) Government consumption
shry(I,FF) Instutional share of factor income
;
tc(C) = 0;
tu(C) = 0;
tq(C) = 0;
tqs(C) = 0;
tm(T,C) = 0;
te(C,T) = 0;
tuf(FF,A) = 0;
tbnew(C,A) = 0;
PMO(C) = 1;
XRO(T) = 1;
PWEO(C,T) = 1;
PEO(C) = 1;
PQO(C) = 1 + tq(C)+ tqs(C);
PDO(C) = PQO(C);
PXO(C) = 1;
PAO(A) = 1;
QMO(C) = SUM(T,SAM(T,C))/PMO(C);
QXO(C) = (SUM(A,SAM(A,C))+ SUM(I,SAM(I,C)))/PXO(C);
display QXO, QMO,PDO;
QDO(C) = (SUM(A,SAM(A,C)) + SUM(I,SAM(I,C)) - SUM(T,SAM(C,T)))/PDO(C);
QQO(C) = (SAM('TOTAL',C) - SUM(T,SAM(C,T)))/PQO(C);
QEO(C) = SUM(T,SAM(C,T))/PEO(C);
QAO(A) = SAM('TOTAL',A)/PAO(A);
display QAO, QDO;
QFO('CAP',A) = SAM('CAP',A);
QFKLO(A) = SAM('CAP',A)+SAM('LAB',A);
$ontext
If the global variable LBR is set to NO, the employment data from IMPLAN will*
not be used. QFO will be set to the numbers in the SAM. *
If LBR is set to YES, the employment data from IMPLAN will be used. QFO will *
be set to the employment data extracted from IMPLAN. In this case, QF *
represents actual number of jobs.
$offtext
QFO('WATER',A) = WATERo(A,'RAW');
* QFO('WATER',A) = SAM('WATER',A);
$SETGLOBAL LBR YES
$IF %LBR% == "NO" $GOTO LW1
QFO('LAB',A) = EMPLOY(A);
$GOTO LW2
$LABEL LW1
QFO('LAB',A) = SAM('LAB',A);
$LABEL LW2
SUMQFO(FF)= SUM(A, QFO(FF,A));
display QFO,SUMQFO;
WFO(FF) = SUM(A, SAM(FF,A))/SUMQFO(FF);
display WFO;
*really specific to labor giving the average wage for whole economy
*can be useful for water also
QINTO(C,A) = SAM(C,A)/PQO(C);
YFO(I,FF) = SAM(I,FF);
*the SAM value will be q*p which is what is needed
PVAO(ANWU) = SUM(FF,SAM(FF,ANWU))/(SAM('TOTAL',ANWU)/PAO(ANWU));
PVAWO(WU) =(SAM('LAB',WU)+SAM('CAP',WU))/(SAM('TOTAL',WU)/PAO(WU));
YHO(H) = SUM(FF,SAM(H,FF)) + SUM(I,SAM(H,I)) + SUM(T,SAM(H,T)) + SUM(C,PXO(C)*SAM(H,C));
NYHO(H) = SUM(C,SAM(C,H));
QHO(C,H) = SAM(C,H)/(PQO(C)*(1+tc(C)));
QINVO(C) = SAM(C,'INV')/PQO(C);
QIINVO(I ) = SAM(I,'INV');
YFGO = SAM("FGOV",'TOTAL');
EFGO = SAM('TOTAL',"FGOV") - SAM('INV',"FGOV");
YSGO = SAM("SGOV",'TOTAL');
ESGO = SAM('TOTAL',"SGOV") - SAM('INV',"SGOV");
QFSO(FF) = SUM(A,SAM(FF,A)/WFO(FF));
*wf is now the $54 per AF and I'll get back the right QFSO
QFSO('WATER')=SUM(A,QFO('WATER',A));
display QFSO;
FSAVXO = SAM('INV','FT');
DSAVXO = SAM('INV','DT');
FIMPRTO(T,FF) = SAM(T,FF);
GTRNSFRO(H,G) = SAM(H,G);
TRNSFRO(G,GG) = SAM(G,GG);
HEXPRTO(H,T) = SAM(H,T);
GEXPRTO(G,T) = SAM(G,T);
HIMPRTO(T,H) = SAM(T,H);
GIMPRTO(T,G) = SAM(T,G);
wfa(FF,A)$QFO(FF,A) = SAM(FF,A)/QFO(FF,A);
display wfa;
*income per job for labor
WFDISTO(FF,A) = wfa(FF,A) / WFO(FF);
*relationship of activity avg wage to economy avg wage
*no initial distortion factor when raw water is zero price
*but use to have differnt water prices in different sectors
display WFDISTO;
INDTO(G) = SAM(G,'INDT');
IMAKEQO(I,C) = SAM(I,C)/PXO(C);
SADJO = 1;
SGADJO = 1;
IADJO = 1;
IIADJO = 1;
IADJSGO1(C) = 1;
IADJSGO2(C) = 1;
ty(G,H) = SAM(G,H)/SAM('TOTAL',H);
tb(A) = SAM('INDT',A)/SAM('TOTAL',A);
tf(FF,A) = 0;
pwm(T,C) = 1;
trh(H,HH) = SAM(H,HH) /((1-SUM(G,ty(G,HH)))*SAM('TOTAL',HH));
display trh;
mps(H) = SAM('INV',H)/((1-SUM(G,ty(G,H)))*SAM('TOTAL',H));
qg(C,G) = SAM(C,G)/PQO(C);
PMRO(T,C) = pwm(T,C)*(1+tm(T,C));
QMRO(T,C) = SAM(T,C)/PMRO(T,C);
PERO(C,T) = PWEO(C,T)*(1-te(C,T));
QERO(C,T) = SAM(C,T)/PERO(C,T);
xshift(C,T) = QERO(C,T)/(PWEO(C,T)**xed(C,T));
SHIFTFFO(FF) = QFSO(FF)/(WFO(FF)**efac(FF));
DISPLAY SHIFTFFO;
SET CM(C),CE(C),CNM(C),CNE(C);
SET CM1(C),CE1(C),CM2(C),CE2(C);
CM(C) = YES$QMO(C);
CE(C) = YES$QEO(C);
CNM(C) = YES$(QMO(C) = 0);
CNE(C) = YES$(QEO(C) = 0);
CM1(C) = YES$((QMRO('FT',C) AND QMRO('DT',C) = 0) OR (QMRO('FT',C) = 0 AND QMRO('DT',C)));
CE1(C) = YES$((QERO(C,'FT') AND QERO(C,'DT') = 0) OR (QERO(C,'FT') = 0 AND QERO(C,'DT')));
CM2(C) = YES$(QMRO('FT',C) AND QMRO('DT',C));
CE2(C) = YES$(QERO(C,'FT') AND QERO(C,'DT'));
theta(A,C) = (SAM(A,C)/PXO(C)) / QAO(A);
display theta;
ica(C,A) = QINTO(C,A)/QAO(A);
*need equivalent of ica for water factor
wica = QFO('WATER','WATER-A')/QAO('WATER-A');
wicashare = SAM('WATER','WATER-A')/QAO('WATER-A');
vashare(A) = 1-tb(A)-SUM(C,ica(C,A)) ;
*QFO of water in different units, price not equal one
vasharew = 1-tb('WATER-A')-SUM(C,ica(C,'WATER-A'))- wicashare;
display wica,vashare,vasharew,wicashare;
rho(A)=1/esubp(A)-1;
del(FF,A) = (WFDISTO(FF,A)*WFO(FF)*QFO(FF,A)**(rho(A)+1))/SUM(FFF,WFDISTO(FFF,A)*WFO(FFF)*QFO(FFF,A)**(rho(A)+1));
delw(FNW) = (WFDISTO(FNW,'WATER-A')*WFO(FNW)*QFO(FNW,'WATER-A')**(rho('WATER-A')+1))/SUM(FFNW,WFDISTO(FFNW,'WATER-A')*WFO(FFNW)*QFO(FFNW,'WATER-A')
**(rho('WATER-A')+1));
ad(A) = (QAO(A)*vashare(A))/(SUM(FF, del(FF,A)*QFO(FF,A)**(-rho(A))))**(-1/rho(A));
adw = (QAO('WATER-A')*vasharew)/(SUM(FNW, delw(FNW)*QFO(FNW,'WATER-A')**(-rho('WATER-A'))))**(-1/rho('WATER-A'));
arho(CM)=1/esubd(CM)-1;
adel(CM)=(QMO(CM)**(1+arho(CM)))*PMO(CM)
/(QMO(CM)**(1+arho(CM))*PMO(CM) + QDO(CM)**(1+arho(CM))*PDO(CM));
aq(CM) = QQO(CM)/(
adel(CM)*QMO(CM)**(-arho(CM))+(1-adel(CM))*QDO(CM)**(-arho(CM)))
**(-1/arho(CM));
srho(CE)=1/esubs(CE)+1;
sdel(CE)=(QEO(CE)**(1-srho(CE)))*PEO(CE)
/(QDO(CE)**(1-srho(CE))*PDO(CE)+QEO(CE)**(1-srho(CE))*PEO(CE));
as(CE) = QXO(CE)/(sdel(CE)*QEO(CE)**(srho(CE))+
(1-sdel(CE))*QDO(CE)**(srho(CE)))
**(1/srho(CE));
erho(CE2) = 1/esube(CE2) + 1;
edel(CE2)=(QERO(CE2,'FT')**(1-erho(CE2)))*PERO(CE2,'FT')
/(QERO(CE2,'FT')**(1-erho(CE2))*PERO(CE2,'FT')
+QERO(CE2,'DT')**(1-erho(CE2))*PERO(CE2,'DT'));
ae(CE2) = QEO(CE2)/
(edel(CE2)*QERO(CE2,'FT')**(erho(CE2))
+(1-edel(CE2))*QERO(CE2,'DT')**(erho(CE2)))
**(1/erho(CE2));
mrho(CM2) = 1/esubm(CM2) - 1;
mdel(CM2)=(QMRO('FT',CM2)**(1+mrho(CM2)))*PMRO('FT',CM2)
/(QMRO('FT',CM2)**(1+mrho(CM2))*PMRO('FT',CM2)
+QMRO('DT',CM2)**(1+mrho(CM2))*PMRO('DT',CM2));
am(CM2) = QMO(CM2)/
(mdel(CM2)*QMRO('FT',CM2)**(-mrho(CM2))
+(1-mdel(CM2))*QMRO('DT',CM2)**(-mrho(CM2)))
**(-1/mrho(CM2));
display ine;
engelwt(H) = 1/SUM(C,(QHO(C,H)*PQO(C)*(1+tc(C))*ine(C,H))/NYHO(H));
ine(C,H) = engelwt(H)*ine(C,H);
beta(C,H)=(QHO(C,H)*PQO(C)*(1+tc(C)))/NYHO(H)*ine(C,H);
lambda(C,H)=(QHO(C,H)*PQO(C)*(1+tc(C))+beta(C,H)*NYHO(H)/frisch(H))/(PQO(C)*(1+tc(C)));
cwts(C) = SUM(H,SAM(C,H))/SUM((CC,H),SAM(CC,H));
CPIO = SUM(C,cwts(C)*PDO(C));
display engelwt,ine,beta,lambda,CPIO;
shry(I,FF) = SAM(I,FF) / (SAM('TOTAL',FF)-SUM(T,SAM(T,FF)));
display shry;
sgovbal = SAM('INV',"SGOV");
FGOVBALO = SAM('INV','FGOV');
GDPO = SUM(A,SAM(A,'TOTAL')) - SAM('INDT','TOTAL') - SUM((C,A),SAM(C,A));
*note that I've temporarily set unit to whatever it is that makes water factor price = 1 in base
PARAMETER wateractunit million AF needed to produce unit of water utility activity;
wateractunit = QFO('WATER','WATER-A')/QAO('WATER-A') ;
display wateractunit;
*POSITIVE
VARIABLES
PM(C) Import price (domestic currency)
XR(T) Exchange rate
PWE(C,T) World export price
PE(C) Export price (domestic currency)
PQ(C) Composite commodity price
PD(C) Domestic price of domestic output
PMR(T,C) Regional price of imported commodities
PER(C,T) Regional price of exported commodities
PA(A) Activity price
PX(C) Producer price
QQ(C) Quantity supplied to domestic commodity demanders
QM(C) Quantity of imports
QD(C) Quantity of domestic output sold domestically
QMR(T,C) Regional imports
QX(C) Quantity of domestic output
QE(C) Quantity of exports
QA(A) Activity level
QFKL(A) Quantity of capital and labor aggregate
QF(FF,A) Quantity of factor FF demanded by activity A
QFS(FF) Factor FF supply
QINT(C,A) Quantity of intermeditate use of commodity C by activity A
YH(H) Gross household income
NYH(H) Net household income
QH(C,H) Household consumption
DUMMY for objective fctn ;
*POSITIVE
VARIABLE
QER(C,T) Regional exports ;
VARIABLES
PVA(ANWU) Value added price
PVAW(WU) Price for composite of labor and capital
WF(FF) Average wage or rental rate of factor FF
YF(I,FF) Factor income
YFG Federal government revenue
EFG Federal government expenditure
YSG State government revenue
ESG State government expenditure
QINV(C) Investment demand
QIINV(I) Investment demand by institutions
WALRAS Dummy variable
IADJ Investment adjustment variable
IIADJ Institutional investment adjustment variable
IADJSG1(C) Investment equation adjustment variable
IADJSG2(C) Stone-Geary investment adjustment variable
IINCOME Total investment expenditures on capital goods (commodities)
OBJ trying to do as lofgren exercise suggests
SADJ Savings adjustment variable
SGADJ State government spending adjustment variable for quantity purchased
WFDIST(FF,A) Wage distortion factor
INDT(G) Total indirect taxes
IMAKEQ(I,C) Make matrix (quantity)
SHIFTFF(FF) Factor supply equation shift variable
FSAVX Exports foreign savings
DSAVX Exports RUS savings
CPI Consumer Price Index
GDP gdp calculation for maximization objective
FGOVBAL federal government surplus or deficit
FIMPRT(T,FF) factor imports
GTRNSFR(H,G) govt transfers to households
TRNSFR(G,GG) intergovernmental transfers
HEXPRT(H,T) household receipts from outside of region sources
GEXPRT(G,T) govt receipts from outside of region sources
HIMPRT(T,H) household imports
GIMPRT(T,G) govt imports
WATER(AI,WT) water use in AF by type
TARIFF collection of tariff revenue or payment of subsidy
DUTY collection of duty revenue or payment of subsidy ;
*with the closures we chose this is now just a definition of a parameter pmr
EQUATION PMDEFF(T,C) Regional foreign import price equation ;
PMDEFF('FT',CM).. PMR('FT',CM) =E= pwm('FT',CM)*(1+tm('FT',CM));
*with the closures we chose this is now just a definition of a parameter pmr
EQUATION PMDEFD(T,C) Regional domestic import price equation ;
PMDEFD('DT',CM)..
PMR('DT',CM) =E= pwm('DT',CM)*(1+tm('DT',CM));
*changing program so that govt will collect tariff
EQUATION TARIFFDEF tariff on imports collected by govt ;
TARIFFDEF.. TARIFF =E= SUM((T,CM),tm(T,CM)*pwm(T,CM)*QMR(T,CM));
*QERO is initial regional exports
EQUATION PEDEFF(C,T) Regional foreign export price equation ;
PEDEFF(CE,'FT')$QERO(CE,'FT')..
PER(CE,'FT') =E= PWE(CE,'FT')*(1-te(CE,'FT'));
EQUATION PEDEFD(C,T) Regional domestic export price equation ;
PEDEFD(CE,'DT')$QERO(CE,'DT')..
PER(CE,'DT') =E= PWE(CE,'DT')*(1-te(CE,'DT'));
*changing program so that govt will collect duty
EQUATION DUTYDEF duty on exports collected by govt ;
DUTYDEF.. DUTY =e= SUM((CE,T), te(CE,T)*QER(CE,T)*PWE(CE,T)) ;
*xshift is shift parameter equal to QERo if PWEo=1
*and xed is elasticity of demand for world export ftn
*experimenting again with fixing PWE
*EQUATION WEXDEM(C,T) World export demand function ;
* WEXDEM(CE,T).. QER(CE,T)$QERO(CE,T) =E= xshift(CE,T)*(PWE(CE,T)**xed(CE,T));
*QM is quantity of imports am is shift parameter mdel is share parameter
* mrho is exponent QMR is regional imports
EQUATION ARMIMP(C) Armington import composite equation ;
ARMIMP(CM2).. QM(CM2) =E= am(CM2)* (mdel(CM2)*QMR('FT',CM2)**(-mrho(CM2))
+(1-mdel(CM2))*QMR('DT',CM2)**(-mrho(CM2)))
**(-1/mrho(CM2));
EQUATION ROWRUSM(C) ROW-RUS import ratio ;
ROWRUSM(CM2).. QMR('FT',CM2)/QMR('DT',CM2) =E=
((PMR('DT',CM2)/PMR('FT',CM2))*(mdel(CM2)/((1-mdel(CM2)))))
**(1/(1+mrho(CM2)));
EQUATION EQMRUS(C) Absorption equation for one imported commodity ;
EQMRUS(CM1)..
QM(CM1) =E= QMR('DT',CM1)$QMRO('DT',CM1) + QMR('FT',CM1)$QMRO('FT',CM1);
* Price for one imported commodity
EQUATION EPMRUS(C) Price for one imported destination ;
EPMRUS(CM1)..
PM(CM1) =E= PMR('DT',CM1)$QMRO('DT',CM1) + PMR('FT',CM1)$QMRO('FT',CM1);
EQUATION IMPVAL(C) Import output value ;
IMPVAL(CM2).. PM(CM2)*QM(CM2) =E= SUM(T,PMR(T,CM2)*QMR(T,CM2));
EQUATION ARMEXP(C) Armington export composite equation;
ARMEXP(CE2).. QE(CE2) =E= ae(CE2)* (edel(CE2)*QER(CE2,'FT')**(erho(CE2))
+(1-edel(CE2))*QER(CE2,'DT')**(erho(CE2)))**(1/erho(CE2));
EQUATION ROWRUSE(C) ROW-RUS export ratio ;
ROWRUSE(CE2).. QER(CE2,'DT')/QER(CE2,'FT') =E=
((PER(CE2,'DT')/PER(CE2,'FT'))*(edel(CE2)/((1-edel(CE2)))))
**(1/(erho(CE2)-1));
EQUATION EXPVAL(C) Export output value ;
EXPVAL(CE2).. PE(CE2)*QE(CE2) =E= SUM(T,PER(CE2,T)*QER(CE2,T));
* Quantity for one exported commodity
EQUATION EQERUS(C) Absorption equation for one exported commodity ;
EQERUS(CE1)..
QE(CE1) =E= QER(CE1,'DT')$QERO(CE1,'DT') + QER(CE1,'FT')$QERO(CE1,'FT');
* Price for one exported commodity
EQUATION EPERUS(C) Price for one exported commodity ;
EPERUS(CE1)..
PE(CE1) =E= PER(CE1,'DT')$QERO(CE1,'DT') + PER(CE1,'FT')$QERO(CE1,'FT');
EQUATION ABSORP(C) Absorption equation ;
ABSORP(C)..
PQ(C)*QQ(C) =E= (1+tq(C))*(PM(C)+tu(C))*QM(C)$CM(C) + (1+tq(C)+tqs(C))*(PD(C)+tu(C))*QD(C);
* PQ(C)*QQ(C) =E= (1+tq(C))*PM(C)*QM(C)$CM(C) + (1+tq(C)+tqs(C))*PD(C)*QD(C);
EQUATION DOMOUT(C) Domestic Output Value ;
DOMOUT(C).. PX(C)*QX(C) =E= PD(C)*QD(C) + PE(C)*QE(C)$CE(C);
*activity price is a weighted average of the commodity prices for the
*commodities produced by that activity
EQUATION PADEF(A) Activity price equation ;
PADEF(A).. PA(A) =E= SUM(C, PX(C)*theta(A,C));
*note: value-added below includes water rents
EQUATION PVADEF(ANWU) Value added price ;
PVADEF(ANWU).. PVA(ANWU) =E= PA(ANWU)*(1 - tb(ANWU)) - SUM(C,(PQ(C)+tbnew(C,ANWU))*ica(C,ANWU))
* - (WF("WATER")*WFDIST("WATER",ANWU)-tuf("WATER",ANWU))*wica
;
EQUATION PVAWDEF(WU) value added price minus water factor rents for water utility sector ;
PVAWDEF(WU).. PVAW(WU) =E= PA(WU)*(1 - tb(WU)) - SUM(C, (PQ(C)+tbnew(C,WU))*ica(C,WU))-(WF("WATER")*WFDIST("WATER",WU)+tuf("WATER",WU))*wica;
*don't want to collect tax twice - water utility water will be taxed as treated
*water commodity - tuf("WATER",ANWU) should be zero
*will need to use this for all activities except water utility
EQUATION PRODN(ANWU) Leontief-CES Production Functions ;
PRODN(ANWU).. QA(ANWU) =E=(ad(ANWU)/vashare(ANWU))
* (SUM(FF, del(FF,ANWU)*QF(FF,ANWU)**(-rho(ANWU))))**(-1/rho(ANWU));
*make a different production function for water utility that forces
*a water balance
*below the water factor is combined in fixed proportions so becomes like
*one of the intermediate demands and isn't in the CES combo of labor and capital
EQUATION WATPROD(WU) water utility production function ;
WATPROD('WATER-A').. QA('WATER-A') =E=(adw/vasharew)
* (delw('LAB')*QF('LAB','WATER-A')**(-rho('WATER-A'))+delw('CAP')*QF('CAP','WATER-A')**(-rho('WATER-A')))**(-1/rho('WATER-A'));
EQUATION FACDEM(FF,ANWU) Factor demand equation ;
FACDEM(FF,ANWU)$WFDISTO(FF,ANWU).. (WFDIST(FF,ANWU)*WF(FF)+tuf(FF,ANWU))*(1+tf(FF,ANWU)) =E=
PVA(ANWU) * (ad(ANWU)/vashare(ANWU))
*(SUM(FFF,del(FFF,ANWU)*QF(FFF,ANWU)**(-rho(ANWU))))**((-1/rho(ANWU))-1)
* del(FF,ANWU)*QF(FF,ANWU)**(-rho(ANWU)-1);
EQUATION WFACDEM(FNW,WU) Factor demand equation ;
WFACDEM(FNW,WU)$WFDISTO(FNW,WU).. (WFDIST(FNW,WU)*WF(FNW)+tuf(FNW,WU))*(1+tf(FNW,WU)) =E=
PVAW(WU) * (adw/vasharew)
*(SUM(FFNW,delw(FFNW)*QF(FFNW,WU)**(-rho(WU))))**((-1/rho(WU))-1)
* delw(FNW)*QF(FNW,WU)**(-rho(WU)-1);
EQUATION WATDEM(WU) Water utility water demand equation ;
WATDEM('WATER-A').. QF('WATER','WATER-A') =E= wica*QA('WATER-A');
EQUATION INTDEM(C,A) Intermediate input demand equation ;
INTDEM(C,A).. QINT(C,A) =E= ica(C,A)*QA(A);
EQUATION ALLOC(C) Output function ;
ALLOC(C)..
QX(C) =E= SUM(A,theta(A,C)*QA(A)) + SUM(I,IMAKEQ(I,C));
EQUATION ARMCOMS(C) Armington commodity composite supply equation ;
ARMCOMS(CM)..
QQ(CM) =E= aq(CM)*(adel(CM)*QM(CM)**(-arho(CM))
+(1-adel(CM))*QD(CM)**(-arho(CM)))**(-1/arho(CM));
EQUATION IMPDEM(C) Import-Domestic demand ratio ;
IMPDEM(CM)..
QM(CM)/QD(CM) =E=
((adel(CM)/(1-adel(CM)))*(PD(CM)/PM(CM)))**(1/(1+arho(CM)));
EQUATION SUPNON(C) Composite supply for nonimported commodities ;
SUPNON(CNM)..
QQ(CNM) =E= QD(CNM);
EQUATION ARMCET(C) Output transformation CET equation ;
ARMCET(CE)..
QX(CE) =E=
as(CE)* (sdel(CE)*QE(CE)**(srho(CE))+(1-sdel(CE))*QD(CE)**(srho(CE)))
**(1/srho(CE));
EQUATION EXPDOM(C) Export-domestic supply ratio ;
EXPDOM(CE).. QE(CE)/QD(CE) =E=
(PE(CE)/PD(CE)*(1-sdel(CE))/sdel(CE))**(1/(srho(CE)-1));
EQUATION OUTNON(C) Output transformation for nonexported commodities;
OUTNON(CNE).. QX(CNE) =E= QD(CNE);
EQUATION FACINC(I,FF) Factor income;
FACINC(I,FF)..
YF(I,FF) =E= shry(I,FF)*(SUM(A,WFDIST(FF,A)*QF(FF,A)*WF(FF))-SUM(T,FIMPRT(T,FF)));
EQUATION HOUSINC(H) Household income ;
HOUSINC(H).. YH(H)
=E= SUM(FF,YF(H,FF)) + SUM(C,PX(C)*IMAKEQ(H,C)) + SUM(G,GTRNSFR(H,G))
+ QIINV(H) + SUM(HH,trh(H,HH)*(1-SUM(G,ty(G,HH)))*YH(HH)) + SUM(T,HEXPRT(H,T));
EQUATION NYHINCOME(H) Net household income ;
NYHINCOME(H).. NYH(H) =E= YH(H) - SUM(HH,trh(HH,H)*(1-SUM(G,ty(G,H)))*YH(H))
- SADJ*mps(H)*(1-SUM(G,ty(G,H)))*YH(H) - SUM(G,ty(G,H))*YH(H)
- SUM(T,HIMPRT(T,H));
EQUATION HOUSDEM(C,H) Household consumption demand ;
HOUSDEM(C,H).. QH(C,H) =E=
lambda(C,H)+(beta(C,H)*(NYH(H)-SUM(CC,lambda(CC,H)*(PQ(CC)*(1+tc(C))))))
/(PQ(C)*(1+tc(C)));
EQUATION INVDEM(C) Investment demand equation ;
INVDEM(C).. QINV(C) =E= QINVO(C);
EQUATION FGOVREV Federal government revenue equation;
FGOVREV.. YFG =E= SUM(H,ty("FGOV",H)*YH(H)) + SUM(T,GEXPRT("FGOV",T))
+ SUM(C,PX(C)*IMAKEQ("FGOV",C)) + QIINV("FGOV")
+ TRNSFR("FGOV","FGOV") + SUM(FF,YF("FGOV",FF)) + INDT("FGOV");
EQUATION FGOVEXP Federal government expenditure equation ;
FGOVEXP.. EFG =E= SUM(H,GTRNSFR(H,"FGOV"))+ SUM(G,TRNSFR(G,"FGOV"))+ SUM(T,GIMPRT(T,"FGOV")) +
SUM(C,PQ(C)*qg(C,"FGOV"));
EQUATION SGOVREV State government revenue equation ;
SGOVREV..
YSG =E= SUM(H,ty("SGOV",H)*YH(H)) + SUM(T,GEXPRT("SGOV",T)) + SUM(G,TRNSFR("SGOV",G))
+ SUM(C,PX(C)*IMAKEQ("SGOV",C)) + QIINV("SGOV") + SUM(FF,YF("SGOV",FF)) + INDT("SGOV")
+ SUM(C,(PM(C)*QM(C)$CM(C) + PD(C)*QD(C))*tq(C))
+ SUM((H,C),PQ(C)*tc(C)*QH(C,H))+ SUM(C,PD(C)*QD(C)*tqs(C))+SUM(C,tu(C)*QQ(C))
+ SUM((FF,A),WF(FF)*WFDIST(FF,A)*QF(FF,A)*tf(FF,A))+SUM((FF,A),tuf(FF,A)*QF(FF,A))
+SUM((C,A),tbnew(C,A)*QINT(C,A));
*method of accounting for import and export taxes and subsidies
*+ DUTY + TARIFF;
EQUATION SGOVEXP State government expenditure equation ;
SGOVEXP.. ESG =E= SUM(G,TRNSFR(G,"SGOV"))+SUM(H,GTRNSFR(H,"SGOV"))+ SUM(T,GIMPRT(T,"SGOV"))
+ SGADJ*SUM(C,PQ(C)*qg(C,"SGOV"));
EQUATION SGOVBUD State government budget balanced ;
SGOVBUD.. YSG =E= ESG
+ sgovbal;
EQUATION FGOVBUD Fed government account balanced ;
FGOVBUD.. YFG =E= EFG
+ FGOVBAL;
EQUATION FACMKT(FF) Factor market equation ;
FACMKT(FF).. SUM(A,QF(FF,A)) =E= QFS(FF);
EQUATION COMPMKT(C) Composite commodity market equation ;
COMPMKT(C).. QQ(C) =E= SUM(A,QINT(C,A)) + SUM(H,QH(C,H)) + qg(C,"FGOV")
+ SGADJ*qg(C,"SGOV") + QINV(C);
EQUATION CURACCF ROW current account balance;
CURACCF..
SUM(CE,PER(CE,'FT')*QER(CE,'FT')$QERO(CE,'FT')) + SUM(H,HEXPRT(H,'FT')) + SUM(G,GEXPRT(G,'FT')) + FSAVX
=E=
SUM(CM,PMR('FT',CM)*QMR('FT',CM)$QMRO('FT',CM)) + SUM(FF,FIMPRT('FT',FF)) + SUM(G,GIMPRT('FT',G))
+ SUM(H,HIMPRT('FT',H))
-SUM(CM,pwm('FT',CM)*QMR('FT',CM)*tm('FT',CM)$QMRO('FT',CM)) ;
EQUATION CURACCD RUS current account balance ;
CURACCD..
SUM(CE,PER(CE,'DT')*QER(CE,'DT')$QERO(CE,'DT')) + SUM(H,HEXPRT(H,'DT')) + SUM(G,GEXPRT(G,'DT'))
+ DSAVX =E=
SUM(CM,PMR('DT',CM)*QMR('DT',CM)$QMRO('DT',CM)) + SUM(FF,FIMPRT('DT',FF)) + SUM(G,GIMPRT('DT',G))
+ SUM(H,HIMPRT('DT',H))
-SUM(CM,pwm('DT',CM)*QMR('DT',CM)*tm('DT',CM)$QMRO('DT',CM)) ;
EQUATION SAVBAL Savings investment balance ;
SAVBAL.. SUM(C,PX(C)*IMAKEQ('INV',C)) + SADJ*SUM(H,mps(H)*(1-SUM(G,ty(G,H)))*YH(H))
+ FGOVBAL + sgovbal + FSAVX + DSAVX + SUM(FF,YF('INV',FF))
=E= SUM(C,PQ(C)*QINV(C)) + SUM(HG,QIINV(HG))
+ WALRAS;
EQUATION NORM Price normalization equation ;
NORM.. SUM(C,(1+tc(C))*PQ(C)*cwts(C)) =E= CPI;
EQUATION INDTCALC(G) Indirect tax calculation ;
INDTCALC(G).. INDT(G) =E= tbshr(G)*SUM(A,tb(A)*PA(A)*QA(A));
EQUATION FACSUP(FF) Factor supply equation ;
* It is a supply function and if QFS is not fixed it needs to be
*able to move up if wages move up - depends on closure chosen
FACSUP(FF)$FNW(FF).. QFS(FF) =E= SHIFTFF(FF)*WF(FF)**efac(FF);
EQUATION OBJFN a dummy variable to maximize ;
OBJFN.. OBJ =E= DUMMY**2;
OPTION NLP=CONOPT;
*according to the solver manual it is safe to use a large value for Domlim
*with CONOPT (domain limit errors such as zero in denominator, etc.) because
*conopt deals with these and can recover and continue
OPTION DOMLIM =1000;
*OPTION MCP=PATH;
MODEL CGEMODEL
/ALL/ ;
*could experiment with names of equations in here below
* /SAVBAL,CURACCD,CURACCF,COMPMKT,SGOVBUD,SGOVEXP,SGOVREV,FGOVEXP,FGOVREV/
*holdfixed = 1 means fixed variables will be treated as constants
CGEMODEL.HOLDFIXED = 1;
* Initialize the variables
PM.L(C) = PMO(C);
*experiment to go to full small country model where PWE is a parameter
PWE.FX(C,T) = PWEO(C,T);
* PWE.L(C,T) = PWEO(C,T);
PE.L(C) = PEO(C);
PQ.L(C) = PQO(C);
PD.L(C) = PDO(C);
QQ.L(C) = QQO(C);
QM.L(C) = QMO(C);
QD.L(C) = QDO(C);
PX.L(C) = PXO(C);
QX.L(C) = QXO(C);
QE.L(C) = QEO(C);
PA.L(A) = PAO(A);
PVA.L(ANWU) = PVAO(ANWU);
PVAW.L(WU) = PVAWO(WU);
QA.L(A) = QAO(A);
QF.L(FF,A) = QFO(FF,A);
*for nest composite
QFKL.L(A) = QFKLO(A);
QINT.L(C,A) = QINTO(C,A);
WF.L(FF) = WFO(FF);
YF.L(I,FF) = YFO(I,FF);
YH.L(H) = YHO(H);
NYH.L(H) = NYHO(H);
QH.L(C,H) = QHO(C,H);
QINV.L(C) = QINVO(C);
YFG.L = YFGO;
EFG.L = EFGO;
YSG.L = YSGO;
ESG.L = ESGO;
* WALRAS.L = 0;
SGADJ.L = SGADJO;
INDT.L(G) = INDTO(G);
QMR.L(T,C) = QMRO(T,C);
QER.L(C,T) = QERO(C,T);
PMR.L(T,C) = PMRO(T,C);
PER.L(C,T) = PERO(C,T);
IMAKEQ.FX(I,C) = IMAKEQO(I,C);
QIINV.FX(I) = QIINVO(I);
FGOVBAL.L = FGOVBALO;
FIMPRT.FX(T,FF)= FIMPRTO(T,FF);
GTRNSFR.FX(H,G) = GTRNSFRO(H,G);
TRNSFR.FX(G,GG) = TRNSFRO(G,GG);
HEXPRT.FX(H,T) = HEXPRTO(H,T);
GEXPRT.FX(G,T) = GEXPRTO(G,T);
HIMPRT.FX(T,H) = HIMPRTO(T,H);
GIMPRT.FX(T,G) = GIMPRTO(T,G);
* DUTY.L =0;
* TARIFF.L = 0;
IF(CAPCLOS EQ 1,
*Capital is fully employed and mobile. WF('CAP') is the market-clearing
*variable for the unified capital market.
WFDIST.FX('CAP',A) = WFDISTO('CAP',A);
SHIFTFF.L('CAP') = SHIFTFFO('CAP');
WF.L('CAP') = WFO('CAP');
QF.L('CAP',A) = QFO('CAP',A);
QFS.FX('CAP') = QFSO('CAP');
);
IF(CAPCLOS EQ 2,
WFDIST.FX('CAP',A) = WFDISTO('CAP',A);
SHIFTFF.FX('CAP') = SHIFTFFO('CAP');
WF.L('CAP') = WFO('CAP');
QF.L('CAP',A) = QFO('CAP',A);
QFS.L('CAP') = QFSO('CAP');
);
IF(CAPCLOS EQ 3,
*Capital is fully employed and activity-specific.
*WFDIST('CAP',A) is the market-clearing variable, one for
*each segment of the capital market.
WFDIST.L('CAP',A) = WFDISTO('CAP',A);
SHIFTFF.FX('CAP') = SHIFTFFO('CAP');
WF.L('CAP') = WFO('CAP');
QF.FX('CAP',A) = QFO('CAP',A);
* QFS.FX('CAP') = QFSO('CAP');
QFS.L('CAP') = QFSO('CAP');
);
IF(LABCLOS EQ 1,
*Labor is fully employed and mobile. WF('LAB') is the market-clearing
*variable for the unified labor market.
WFDIST.FX('LAB',A) = WFDISTO('LAB',A);
SHIFTFF.L('LAB') = SHIFTFFO('LAB');
WF.L('LAB') = WFO('LAB');
QF.L('LAB',A) = QFO('LAB',A);
QFS.FX('LAB') = QFSO('LAB');
);
IF(LABCLOS EQ 2,
*Labor is fully employed and mobile. WF('LAB') is the market-clearing
*variable for the unified capital market.
WFDIST.FX('LAB',A) = WFDISTO('LAB',A);
SHIFTFF.FX('LAB') = SHIFTFFO('LAB');
WF.L('LAB') = WFO('LAB');
QF.L('LAB',A) = QFO('LAB',A);
QFS.L('LAB') = QFSO('LAB');
);
IF(LABCLOS EQ 3,
*Labor is unemployed and mobile. For each activity, the wage,
*WFDIST('LAB',A)*WF('LAB'), is fixed. QFS('LAB') is the market-clearing
*variable for the unified labor market.
WFDIST.FX('LAB',A) = WFDISTO('LAB',A);
SHIFTFF.L('LAB') = SHIFTFFO('LAB');
WF.FX('LAB') = WFO('LAB');
QF.L('LAB',A) = QFO('LAB',A);
QFS.L('LAB') = QFSO('LAB');
);
* WATER
IF(WATCLOS EQ 1,
*WATER is fully employed and mobile. WF('water') is the market-clearing
*variable for the unified WATER market.
WFDIST.FX('WATER',A) = WFDISTO('water',A);
SHIFTFF.LO('water') = -INF;
SHIFTFF.L('water') = SHIFTFFO('water');
SHIFTFF.UP('water') = +INF;
WF.LO('water') = -INF;
WF.UP('water') = +INF;
WF.L('water') = WFO('water');
QF.LO('water',AW) = 0;
QF.FX('WATER',ANW) = 0;
QF.UP('water',AW) = +INF;
QF.L('water',AW) = QFO('water',AW);
QFS.FX('water') = QFSO('water');
);
IF(WATCLOS EQ 2,
WFDIST.FX('water',A) = WFDISTO('water',A);
SHIFTFF.FX('water') = SHIFTFFO('water');
WF.LO('water') = -INF;
WF.UP('water') = +INF;
WF.L('water') = WFO('water');
QF.LO('water',A) = -INF;
QF.UP('water',A) = +INF;
QF.L('water',A) = QFO('water',A);
QFS.LO('water') = -INF;
QFS.UP('water') = +INF;
QFS.L('water') = QFSO('water');
);
IF(WATCLOS EQ 3,
*WATER is fully employed and activity-specific.
*WFDIST('water',A) is the market-clearing variable, one for
*each segment of the WATER market.
WFDIST.LO('water',AW) = -INF;
* WFDIST.LO('water',AW) = 0;
WFDIST.UP('water',AW) = +INF;
WFDIST.L('water',AW) = WFDISTO('water',AW);
SHIFTFF.FX('water') = SHIFTFFO('water');
WF.LO('water') = -INF;
WF.UP('water') = +INF;
WF.L('water') = WFO('water');
QF.LO('water',AW) = 0;
QF.FX('water',AW) = QFO('water',AW);
QF.FX('WATER',ANW) = 0;
* QFS.LO('water') = -INF;
* QFS.UP('water') = +INF;
QFS.FX('water') = QFSO('water');
);
*SAVINGS-INVESTMENT BALANCE
*Investment-driven savings -- MPS('U-HHD') is flexible, permitting
*the savings value to adjust.
CPI.FX = CPIO;
SADJ.L = SADJO;
*THE FOREIGN EXCHANGE MARKET
*The exchange rate is fixed. Flexible foreign savings clears
*the current account of the balance of payments.
FSAVX.L = FSAVXO;
*The exchange rate is fixed. Flex RUS savings clears
*the current account of the balance of payments.
DSAVX.L = DSAVXO;
*SOLVE CGEMODEL USING MCP;
SOLVE CGEMODEL USING NLP MAXIMIZING OBJ;
*Option limrow=0;
$BATINCLUDE "%PROGPATH%REPORT45foot.GMS" OUTPUT45
$INCLUDE "%PROGPATH%LOOP5.GMS"