$title TUG-CGE.gms: A Tool for UnderGraduates $Ontext TUG-CGE.gms is a tool for undergraduates to use in conjunction with exercises to teach economic concepts in to students interested in undergraduate economics. It is based on the model ERS-MCP.gms from the GAMS Model library which is documented as follows: U.S. CGE MODEL WITH 1982 DATA BASE, Billions of Dollars. USDA/ERS GNP Version, April 1990. Programmed by: Sherman Robinson, Kenneth Hanson, and Maureen Kilkenny. The model is based on GNP data, and includes exports and imports of factor services. Robinson, S, Kilkenny, M, and Hanson, K, The USDA/ERS Computable General Equilibrium (CGE) Model of the United States. Tech. rep., USDA/ERS, 1990. TUG-CGE.gms edits the ERS-MCP.gms code to make it compatible with GTAP v7 summary matrices found at www.gtap.org; all GTAP v7 data are in billions of US dollars for 2005. This material is based upon activities supported by the National Science Foundation under Agreement No DUE-0632836. Any opinions, findings, and conclusions or recommendations expressed are those of the authors and do not necessarily reflect the views of the National Science Foundation. $Offtext option decimals = 6 ; * the institution names and the factor names "capital" and "land" * are referred to explicitly below. if changed, they must also be * changed where referenced. * the printing of the gnp accounts assume that there is a sector * labeled "service." * Read in data from GTAP Summary Matrix: $include TUG-DATA1b.gms * Additional Tables with input for ERS model TABLE SINTYH(HH,INS) Household distribution of institutional income labr ent prop hous 1 1 1 ; TABLE HHPAR(HHPM,HH) Household parameter for distribution hous thsh 1 rhsh 1 ; * Note, SUM(c,IMAT(c,a)) = 1 by definition; since there is no info about the * capital composition matrix in GTAP and there are 10 sectors, assume equal shares PARAMETER IMAT(c,a) capital composition matrix by activity ; IMAT(c,a) = 0.1 ; *## subsets defined below: "define indexes" Set aag(a) ag activities / A_AGR / aagn(a) non ag activities cag(c) ag commodities / C_AGR / cagn(c) non ag sectors ce(c) export sectors ced(c) sectors with export demand eqn cedn(c) sectors with no export demand eqn cen(c) non export sectors cm(c) import sectors cmn(c) non import sectors ; *## for asam set isam categories /commdty,activity,valuad,insttns,households, gov,kaccount,world,tot/ isam1(isam) /tot/ isam2(isam) ; alias(isam2,isam3); parameter asam(isam,isam) macro social accounting matrix ; isam2(isam) = not isam1(isam) ; *######################## parameter declaration ###################### parameters *### read in parameters *## read in for initialization of variables enttax0 enterprise tax revenue entsav0 enterprise savings exr0 exchange rate e0(c) exports fbor0 net foreign borrowing fctres1(f,a) factor demand by sector fctry(f,a) factor income by sector fsav0 net foreign savings gent0 payments from government to enterprises govsav0 government savings hhsav0 household savings hht0 household transfers invest0 total investment m0(c) imports mps0(hh) household marginal propensity to save pd0(c) domestic goods price pe0(c) domestic price of exports pindex0 gnp deflator pm0(c) domestic price of imports remit0 net remittances from abroad sstax0 social security tax revenue tothhtax0 household tax revenue QX0(c) quantity of aggregate marketed commodity output QA0(a) quantity of domestic activity *## read in parameters as rates, shares, elasticities depr(a) depreciation rates esr enterprise savings rate etr enterprise tax rate htax(hh) household tax rate io(c,a) input output coefficients or use matrix coefficients itax(a) indirect tax rates rhsh(hh) household remittance share rhoc(c) armington function exponent rhoe(c) export demand price elasticity rhot(c) cet function exponent sstr social security tax rate te(c) export subsidy rates tm(c) tariff rates on imports ts(c) sales taxes on composite commidity thsh(hh) household shares of government transfers cles(c,hh) household consumption shares shac(a,c) share of activity a to commodity c *### computed parameters from read in data (calibration) *## computed parameters for initialization of variables deprecia0 total depreciation expenditure fd0(f) factor demand, aggregate fs0(f) factor supply, aggregate int0(c) intermediate input demand netsub0 export duty revenue p0(c) price of composite good pa0(a) output price of activity a pk0(a) capital goods price by sector of destination pva0(a) value added price by sector pwm(c) world market price of imports (in dollars) pwe0(c) world price of exports pwse(c) world price of export substitutes px0(c) average output price averaged over domestic and export sales var0(a) value added rate by sector wfdist(f,a) factor price sectoral proportionality constants wf0(f) factor price, aggregate average xxd0(c) domestic sales, volumne x0(c) composite good supply, volumne yfctr0(f) factor income summed over sector yfsect0(a) factor income by sector yh0(hh) household income yinst0(ins) institutional income *## computed parameters as rates, shares acc(c) armington function shift parameter ad(a) production function shift parameter alpha(f,a) factor share parameter-production function at(c) cet function shift parameter delta(c) armington function share parameter econst(c) export demand constant gamma(c) cet function share parameter pwts(c) price index weights qd(a) dummy variable for computing ad(i) qbarinv(c) fixed real investment (productive plus inventory) qbarg(c) fixed real govt spending (volume) rmd(c) ratio of imports to domestic sales sumsh sum of share correction parameter sumhhsh(hh) sum of share for hh cles * sumimsh(i) sum of share for imat tereal(c) real export subsidy rate in 1982 dollars tmreal(c) real tariff rate in 1982 dollars ; *## tables used for loading variable results * table scalres(*) aggregate results * table sectres(*,i) sectoral price and quantity results * table fctres1(i,f) factor demand results * table fctres2(*,f) factor wage, supply and income results * table insres(*,ins) institutional income results * table hhres(*,hh) household savings and income results *############ specify parameters from SAM ################### entsav0 = SAM('CGDS','ENT') ; enttax0 = SAM('ENTTAX','ENT') ; exr0 = 1 ; fbor0 = SAM('GOVT','WW_WORLD') ; fsav0 = SAM('CGDS','WW_WORLD') ; gent0 = SAM('ENT','GOVT') ; govsav0 = SAM('CGDS','GOVT') ; hhsav0 = SUM(HH, SAM('CGDS',HH)) ; hht0 = SUM(HH, SAM(HH,'GOVT')) ; invest0 = SAM('TOTAL','CGDS') ; pindex0 = 1 ; * FOR A SINGLE HOUSEHOLD (WHICH IS THE CASE FOR GTAP SUMMARY MATRICIES) remit0 = SUM(HH, SAM(HH,'WW_WORLD')) ; sstax0 = SAM('SSTAX','SKLAB') ; tothhtax0 = SUM(HH, SAM('DIRTAX',HH)) ; display entsav0, enttax0, exr0, fbor0, fsav0, gent0, govsav0, hhsav0, hht0, invest0, pindex0, remit0, sstax0, tothhtax0 ; pa0(a) = 1 ; px0(c) = 1 ; pe0(c) = 1 ; pm0(c) = 1 ; * when there is a sales tax on the composite good, its price is not one * p0(c) = 1 ; pd0(c) = 1 ; pk0(a) = 1 ; E0(c) = (SAM(c,"WW_WORLD") - SAM('TEE_WORLD',c))/PE0(c) ; econst(c) = e0(c) ; m0(c) = (SAM('TMM_WORLD',C) + SAM('WW_WORLD',C))/pm0(c) ; QA0(a) = (SAM('TOTAL',A))/PA0(a) ; QX0(c) = SUM(a, SAM(A,C))/PX0(c); xxd0(c) = QX0(c) - e0(c) ; x0(c) = xxd0(c) + m0(c) ; P0(c)$x0(c) = (SAM(c,'total') - SAM(c,'WW_WORLD'))/x0(c) ; display pa0, px0, pe0, pm0, p0, pd0, pk0, e0, econst, m0, qa0, qx0 ; io(c,a) = (SAM(c,a)/P0(c))/QA0(a) ; rhoc(c) = (1/TRADELAS(c,'SIGMAQ')) - 1 ; rhoe(c) = TRADELAS(C,'SIGMAE'); rhot(c) = (1/TRADELAS(C,'SIGMAT')) + 1; display io, rhoc, rhoe, rhot; *#### define indexes based on read in data aagn(a) = not aag(a); cagn(c) = not cag(c); ce(c) = yes$e0(c); ced(c) = yes$rhoe(c); cedn(c) = not ced(c); cen(c) = not ce(c); cm(c) = yes$m0(c); cmn(c) = not cm(c); display aagn, cagn, c, ced, cedn, cen, cm, cmn ; * KT tax rates done here -- keep that as a heading? *## specify parameters which depend on defined index im and ie tm(cmn) = 0.0 ; tm(c)$cm(c) = SAM('TMM_WORLD',C)/SAM('WW_WORLD',C) ; te(cen) = 0.0 ; te(c)$ce(c) = SAM('TEE_WORLD',C)/SAM(C,'WW_WORLD') ; ts(c) = SAM('SALTAX',C)/(P0(C)*X0(C)) ; *## compute from initial data itax(a) = SAM('PRODTAX',A)/(pa0(a)*qa0(a)) ; int0(c) = sum(a, io(c,a)*qa0(a)); pva0(a) = pa0(a) - sum(c, io(c,a)*p0(c)) - itax(a) ; PWE0(C)$E0(C) = (SAM(C,'WW_WORLD')/EXR0) / E0(C); pwm(c)$m0(c) = (SAM("ww_world",c)/EXR0)/M0(c) ; var0(a) = pva0(a) + itax(a) ; display tm, te, ts, itax; display int0, pva0, pwe0, pwm, var0, xxd0 ; *## for 1982 tmreal and tereal are derive from tm and te *## for other years read in tmreal and tereal tmreal(c) = tm(c)*pwm(c)*exr0 ; tereal(c) = te(c)*pwe0(c)*exr0 ; netsub0 = sum(c, te(c)*e0(c)*pwe0(c))*exr0 ; *################ calibration of parameters from data ############# fctry(f,a) = SAM(f,a) ; * note, for any GTAP data base, factor payment = quantity of factors, so wfdist = 1 * fctres1(f,a) = QFBASE(f,a) ; fctres1(f,a) = SAM(f,a) ; *## factor market parameters fs0(f) = sum(a,fctres1(f,a)) ; yfctr0(f) = sum(a, fctry(f,a)) ; yfsect0(a) = sum(f, fctry(f,a)) ; wf0(f) = SUM(a, SAM(f,a))/SUM(a, fctres1(f,a)); wfdist(f,a)$fctres1(f,a) = (fctry(f,a)/fctres1(f,a))/wf0(f) ; wfdist(f,a)$(fctres1(f,a) eq 0) = 0.0 ; display fctry, fctres1, fs0, yfctr0, yfsect0, wf0, wfdist; *## institutional and household income, tax rate, and saving rate depr(a) = 0.0 ; deprecia0 = sum(a, depr(a)*pk0(a)*fctres1('capital',a) ) ; sstr = sstax0/yfctr0("SKLAB") ; etr = enttax0/(yfctr0("capital") + gent0 - deprecia0) ; esr = entsav0/(yfctr0("capital") - enttax0 + gent0 - deprecia0) ; yinst0("labr") = (1.0 - sstr)*yfctr0("sklab") + yfctr0('unsklab'); yinst0("ent") = yfctr0("capital") - entsav0 - enttax0 + gent0 - deprecia0 ; yinst0("prop") = yfctr0("land") + yfctr0("natres"); *## note, household income is from factors (yhva0) and transfers *## where, yhva0(hh) = sum(ins, sintyh(hh,ins)*yinst0(ins)) rhsh(hh) = HHPAR('rhsh',hh) ; thsh(hh) = HHPAR('thsh',hh) ; yh0(hh) = sum(ins, sintyh(hh,ins)*yinst0(ins)) + remit0*rhsh(hh)*exr0 + hht0*thsh(hh) ; display depr, deprecia0, sstr, etr, esr, yinst0, yh0 ; htax(hh) = SAM('DIRTAX',HH)/yh0(hh) ; mps0(hh) = SAM('CGDS',HH)/(yh0(hh)*(1 - htax(hh))) ; cles(c,hh) = SAM(C,HH)/SUM(CP, SAM(CP,HH)) ; shac(a,c) = SAM(A,C)/SUM(CP, SAM(A,CP)) ; display htax, mps0, cles, shac ; *#### calibration of shift and share parameters #### *## for imports-domestic composite *## get delta from costmin, xo from absorption, ac from armington delta(c) = (pm0(c)/pd0(c))*(m0(c)/xxd0(c))**(1+rhoc(c)) ; delta(c) = delta(c)/(1.0+delta(c)) ; rmd(c) = m0(c)/xxd0(c) ; acc(c)$cm(c) = x0(c)/(delta(c)*m0(c)**(-rhoc(c)) +(1-delta(c))*xxd0(c)**(-rhoc(c)))**(-1/rhoc(c)) ; acc(c)$cmn(c) = 1.0 ; display delta,ac,rmd ; *## for exports *## get gamma from esupply gamma(c) = 1/(1 + pd0(c)/pe0(c)*(e0(c)/xxd0(c))**(rhot(c)-1)); *## get at from cet at(c) = qx0(c)/(gamma(c)*e0(c)**rhot(c) + (1-gamma(c))* xxd0(c)**rhot(c))**(1/rhot(c)) ; display gamma,at ; *## for factor demand *## get alpha from profit max (alpha for each i should sum to 1) alpha(f,a) = (wfdist(f,a)*wf0(f)*fctres1(f,a))/yfsect0(a) ; display alpha ; *## get ad from output and fd0 from profitmax qd(a) = prod(f, fctres1(f,a)**alpha(f,a)) ; ad(a) = QA0(a)/qd(a); fd0(f) = sum(a,(qa0(a)*pva0(a)*alpha(f,a)/(wfdist(f,a)* wf0(f)))$wfdist(f,a)) ; display ad,qd,fd0 ; *## specify weights for producer price index pwts(c) = qx0(c)/sum(cp, qx0(cp)) ; display pwts ; *#### end of calibration #### *##################################################################### variables *#################### variable declaration ########################## *## price block exr exchange rate ($ per world $) p(c) price of composite goods pa(a) output price of activity a pd(c) domestic prices pe(c) domestic price of exports pindex gnp deflator pk(a) price of capital goods by sector of destination pm(c) domestic price of imports pva(a) value added price pwe(c) world price of exports px(c) average output price averaged over domestic and export sales *## production block e(c) exports m(c) imports x(c) composite goods supply QX(c) quantity of aggregate marketed commodity output QA(a) quantity of domestic activity xxd(c) domestic sales *## factor block fs(f) factor supply fdsc(f,a) factor demand by sector wf(f) average factor price yfctr(f) factor income *## income and expenditure block cd(c) final demand for private consumption deprecia total depreciation expenditure entsav enterprise savings enttax enterprise tax revenue fbor net foreign borrowing fsav net foreign savings gadj government demand scaling factor gd(c) final demand for government consumption gent payments from govt to ent govsav government savings gr government revenue hhsav total household savings hht household transfers iadj investment scaling factor id(c) final demand for productive investment indtax indirect tax revenue int(c) intermediates uses invest total investment (real) mps(hh) marginal propensity to save by household type netsub export duty revenue remit net remittances from abroad saltax total sales tax revenue savings total savings sstax social security tax revenue tariff tariff revenue tothhtax household tax revenue walras walras variable yh(hh) household income yinst(ins) institutional income *## gnp calculations rgnp real gnp gnpva value added in market prices gnp ; *################## variable initialization ######################### *## use initial values of variables (from parameter specification) exr.l = exr0 ; fbor.l = fbor0 ; fsav.l = fsav0 ; gent.l = gent0 ; govsav.l = govsav0 ; hht.l = hht0 ; invest.l = invest0 ; pindex.l = pindex0 ; remit.l = remit0 ; mps.l(hh) = mps0(hh) ; pa.l(a) = pa0(a) ; pd.l(c) = pd0(c) ; p.l(c) = p0(c) ; px.l(c) = px0(c) ; pm.l(c) = pm0(c) ; pe.l(c) = pe0(c) ; qa.l(a) = qa0(a) ; qx.l(c) = qx0(c) ; e.l(c) = e0(c) ; m.l(c) = m0(c) ; fdsc.l(f,a) = fctres1(f,a) ; yfctr.l(f) = sum(a, fctry(f,a)) ; *## compute initial values for other variables *## output and price xxd.l(c) = qx.l(c) - e.l(c) ; x.l(c) = (pd.l(c)*xxd.l(c) + (pm.l(c)*m.l(c))$cm(c))/(p.l(c)*(1-ts(c))) ; pk.l(a) = sum(c, p.l(c)*imat(c,a)) ; pwe.l(c) = pe.l(c)/((1.0 - te(c))*exr.l) ; pwse(c) = pwe.l(c) ; pva.l(a) = pa.l(a) - sum(c, io(c,a)*p.l(c)) - itax(a) ; *## value added and the flow of factor income fs.l(f) = sum(a, fdsc.l(f,a)) ; wf.l(f) = yfctr.l(f)/fs.l(f) ; netsub.l = sum(ce, te(ce)*e.l(ce)*pwe.l(ce))*exr.l ; tariff.l = sum(cm, pwm(cm)*m.l(cm)*tm(cm))*exr.l ; parameter tmchk(c) ; tmchk(c) = pwm(c)*m.l(c)*tm(c)*exr.l ; display tmchk, pwm, m.l, tm ; sstax.l = sstr*yfctr.l("sklab") ; indtax.l = sum(a, itax(a)*pa.l(a)*qa.l(a)) ; deprecia.l = sum(a, depr(a)*pk.l(a)*fdsc.l("capital",a)) ; enttax.l = etr*(yfctr.l("capital") + gent.l - deprecia.l) ; saltax.l = SUM(c, ts(c)*P.L(c)*X.L(C)) ; entsav.l = esr*(yfctr.l("capital") + gent.l - (enttax.l + deprecia.l)) ; yinst.l("labr") = yfctr.l("sklab") - sstax.l + yfctr.l('unsklab'); yinst.l("ent") = yfctr.l("capital") + gent.l - (entsav.l + enttax.l + deprecia.l) ; yinst.l("prop") = yfctr.l("land") + yfctr.l('natres'); yh.l(hh) = sum(ins, sintyh(hh,ins)*yinst.l(ins)) + remit.l*rhsh(hh)*exr.l + hht.l*thsh(hh) ; tothhtax.l = sum(hh, htax(hh)*yh.l(hh)) ; hhsav.l = sum(hh, mps.l(hh)*yh.l(hh)*(1.0 - htax(hh))) ; display 'kt test' ; display hhsav.l, tothhtax.l, yinst.l ; *## final demand int.l(c) = sum(a,io(c,a)*qa.l(a)) ; cd.l(c) = sum(hh, cles(c,hh)*(1.0 - mps.l(hh))*yh.l(hh) *(1.0 - htax(hh)))/p.l(c) ; qbarinv(c) = SAM(c,'CGDS')/P0(c) ; id.l(c) = qbarinv(c) ; iadj.l = 1 ; qbarg(C) = SAM(C,'GOVT')/P0(C) ; gd.l(c) = qbarg(c) ; gadj.l = 1 ; gr.l = tariff.l + netsub.l + indtax.l + tothhtax.l + sstax.l + enttax.l + fbor.l*exr.l + saltax.l; savings.l = hhsav.l + govsav.l + deprecia.l + fsav.l*exr.l + entsav.l ; display savings.l ; display qbarinv, id.l, qbarg, gd.l; *## gnp gnpva.l = sum(a, pva.l(a)*qa.l(a)) + indtax.l + tariff.l + netsub.l + saltax.l ; rgnp.l = sum(c, cd.l(c) + id.l(c) + gd.l(c)) + sum(ce, (1.0 - tereal(ce)) * e.l(ce) ) - sum(cm, (1.0 - tmreal(cm)) * m.l(cm) ) ; pindex.l = gnpva.l/rgnp.l ; *## alternatively, set pindex to the producer price index * pindex.l = sum(i, pwts(i)*px(i)) ; walras.l = 0.0 ; *###################### end variable specification ################### *#### to check for data consistency, display initial macro SAM, ASAM *###################### social accounting matrix ####################### * KT note, now export out of the commodity account asam("commdty","activity") = sum(c,(p.l(c)*int.l(c))) ; asam("commdty","households") = sum(c,(p.l(c)*cd.l(c))) ; asam("commdty","kaccount") = sum(c,(p.l(c)*(id.l(c)))) ; asam("commdty","gov") = sum(c,(p.l(c)*gd.l(c))) ; asam("commdty","world") = sum(c,((exr.l*pwe.l(c))*e.l(c))) ; asam("activity","commdty") = sum(c, px.l(c)*qx.l(c)) ; * - (pe.l(c)*e.l(c)) ) ; * asam("activity","gov") = netsub.l ; asam("valuad","activity") = sum(f, yfctr.l(f)) ; asam("insttns","valuad") = sum(f,yfctr.l(f)) - sstax.l ; asam("insttns","gov") = gent.l ; asam("households","insttns") = sum((ins,hh),sintyh(hh,ins)*yinst.l(ins)); asam("households","gov") = hht.l ; asam("kaccount","insttns") = entsav.l + deprecia.l ; asam("kaccount","households") = hhsav.l ; asam("kaccount","gov") = govsav.l ; asam("gov","commdty") = tariff.l + saltax.l + netsub.l; asam("gov","activity") = indtax.l ; asam("gov","valuad") = sstax.l ; asam("gov","insttns") = enttax.l ; asam("gov","households") = tothhtax.l ; asam("world","commdty") = sum(c,((pwm(c)*exr.l)*m.l(c))) ; asam("world","households") = - remit.l*exr.l ; asam("world","gov") = - fbor.l*exr.l ; asam("world","kaccount") = - fsav.l*exr.l ; asam("tot","commdty") = sum(isam2,asam(isam2,"commdty")) ; asam("tot","activity") = sum(isam2,asam(isam2,"activity")) ; asam("tot","valuad") = sum(isam2,asam(isam2,"valuad")) ; asam("tot","insttns") = sum(isam2,asam(isam2,"insttns")) ; asam("tot","households") = sum(isam2,asam(isam2,"households")) ; asam("tot","kaccount") = sum(isam2,asam(isam2,"kaccount")) ; asam("tot","gov") = sum(isam2,asam(isam2,"gov")) ; asam("tot","world") = sum(isam2,asam(isam2,"world")) ; asam(isam3,"tot") = sum(isam2,asam(isam3,isam2)) ; option decimals=2 ; display asam ; option decimals=3 ; *##################################################################### equations *#################### equation declaration ########################### *## price block pmdef(c) definition of domestic import prices pedef(c) definition of domestic export prices absorption(c) value of domestic sales sales(c) value of domestic output actp(a) definition of activity prices pkdef(a) definition of capital goods price pindexdef definition of general price level *## production block padef(a) composite price of output by activity a activity(a) production function profitmax(f,a) first order conditions for profit maximum inteq(c) total intermediate uses outaggfn(c) output aggregation function cet(c) cet function cet2(c) domestic sales for nontraded sectors esupply(c) export supply edemand(c) export demand functions armington(c) composite good aggregation function armington2(c) composite good agg. for nontraded sectors costmin(c) f.o.c. for cost minimization of composite good *## income block yfctreq(f) factor income labory labor income propy property income enty enterprise income hhy(hh) household income tariffdef tariff revenue indtaxdef indirect taxes on domestic production netsubdef export subsidies taxss social security tax etax enterprise tax stax sales tax hhtaxdef total household taxes collected by govt. depreq depreciation expenditure esave enterprise savings hhsaveq household savings greq government revenue totsav total savings *## expenditure block cdeq(c) private consumption behavior gdeq(c) govt consumption of commodities gruse government savings ieq(c) investment by sector of origin *## market clearing equil(c) goods market equilibrium fmequil(f) factor market equilibrium caeq current account balance (bill dollars) savinveq savings investment equilibrium *KT alternative name from IFPRI, SAVINVBAL *## the walras equation is redundant, *## given that the model satisfies walras' law. *## in this case, we drop the savings-investment balance equation. *## gross national product gnpy total value added including indtax gnpr real gnp ; *######################## equation assignment ####################### *## price block pmdef(cm).. pm(cm) =e= pwm(cm)*exr*(1 + tm(cm)) ; pedef(ce).. pe(ce) =e= pwe(ce)*(1 - te(ce))*exr ; absorption(c).. p(c)*x(c)*(1-ts(c)) =e= pd(c)*xxd(c) + (pm(c)*m(c))$cm(c) ; sales(c).. px(c)*qx(c) =e= pd(c)*xxd(c) + (pe(c)*e(c))$ce(c) ; actp(a).. pva(a) =e= pa(a)*(1.0-itax(a)) - sum(c,io(c,a)*p(c)) ; pkdef(a).. pk(a) =e= sum(c, p(c)*imat(c,a)) ; pindexdef.. pindex =e= gnpva/rgnp ; *## production block padef(a).. pa(a) =e= SUM(c, shac(a,c)*px(c)) ; activity(a).. qa(a) =e= ad(a)*prod(f$alpha(f,a), fdsc(f,a)**alpha(f,a)) ; profitmax(f,a)$wfdist(f,a).. wf(f)*wfdist(f,a)*fdsc(f,a) =e= qa(a)*pva(a)*alpha(f,a) ; inteq(c).. int(c) =e= sum(a, io(c,a)*qa(a)); outaggfn(c).. qx(c) =e= SUM(a, shac(a,c)*QA(a)) ; cet(ce).. qx(ce) =e= at(ce)*(gamma(ce)*e(ce)**rhot(ce) + (1-gamma(ce))*xxd(ce)**rhot(ce))**(1/rhot(ce)) ; cet2(cen).. qx(cen) =e= xxd(cen) ; esupply(ce).. e(ce) =e= xxd(ce)*(pe(ce)/pd(ce)*(1 - gamma(ce)) /gamma(ce))**(1/(rhot(ce)-1)) ; edemand(ced).. e(ced) =e= econst(ced)*((pwe(ced)/pwse(ced)) **(-rhoe(ced))) ; armington(cm).. x(cm) =e= acc(cm)*(delta(cm)*m(cm)**(-rhoc(cm)) + (1 - delta(cm))*xxd(cm)**(-rhoc(cm)))**(-1/rhoc(cm)) ; armington2(cmn).. x(cmn) =e= xxd(cmn) ; costmin(cm).. m(cm)/xxd(cm) =e= (pd(cm)/pm(cm)*delta(cm)/ (1 - delta(cm)))**(1/(1 + rhoc(cm))) ; *## income block yfctreq(f).. yfctr(f) =e= sum(a, wf(f)*wfdist(f,a)*fdsc(f,a)); labory.. yinst("labr") =e= yfctr('sklab') - sstax + yfctr('unsklab'); propy.. yinst("prop") =e= yfctr("land") + yfctr('natres') ; enty.. yinst("ent") =e= yfctr("capital") + gent - (entsav + enttax + deprecia) ; hhy(hh).. yh(hh) =e= sum(ins, sintyh(hh,ins)*yinst(ins)) + remit*rhsh(hh)*exr + hht*thsh(hh) ; tariffdef.. tariff =e= sum(cm, tm(cm)*m(cm)*pwm(cm))*exr ; indtaxdef.. indtax =e= sum(a, itax(a)*pa(a)*qa(a)) ; netsubdef.. netsub =e= sum(ce, te(ce)*e(ce)*pwe(ce))*exr ; taxss.. sstax =e= sstr*yfctr("sklab") ; stax.. saltax =e= SUM(c, ts(c)*p(c)*x(c)) ; etax.. enttax =e= etr*(yfctr("capital") - deprecia + gent) ; hhtaxdef.. tothhtax =e= sum(hh, htax(hh)*yh(hh)) ; depreq.. deprecia =e= sum(a, depr(a)*pk(a)*fdsc("capital",a)) ; esave.. entsav =e= esr*(yfctr("capital")+gent-enttax-deprecia); hhsaveq.. hhsav =e= sum(hh, mps(hh)*yh(hh)*(1 - htax(hh))) ; greq.. gr =e= tariff + netsub + indtax +tothhtax + sstax + enttax + fbor*exr + saltax ; totsav.. savings =e= hhsav + govsav + deprecia + fsav*exr + entsav ; *## expenditure block cdeq(c).. p(c)*cd(c) =e= sum(hh, cles(c,hh)*(1-mps(hh))*yh(hh) *(1-htax(hh))) ; gdeq(c).. gd(c) =e= GADJ*qbarg(c) ; gruse.. gr =e= sum(c, p(c)*gd(c)) + govsav + gent + hht ; ieq(c).. id(c) =e=IADJ*qbarinv(c) ; equil(c).. x(c) =e= int(c) + cd(c) + gd(c) + id(c) ; fmequil(f).. sum(a, fdsc(f,a)) =e= fs(f) ; caeq.. sum(cm, pwm(cm)*m(cm)) =e= sum(ce, pwe(ce)*e(ce)) + fsav + remit + fbor ; *walras.. savings =e= invest; savinveq.. savings =e= SUM(c, P(c)*ID(c)) + WALRAS ; *#### gross national product gnpy.. gnpva =e= sum(a,pva(a)*qa(a)) + indtax + tariff + saltax + netsub ; gnpr.. rgnp =e= sum(c,cd(c) + id(c) + gd(c)) + sum(ce,(1.0 - tereal(ce)) * e(ce) ) - sum(cm,(1.0 - tmreal(cm)) * m(cm) ) ; *#### additional restrictions corresponding to equations *# pmdef, pedef, edemand, esupply, costmin, and profitmax *# for non-traded sectors and sectors with fixed world export prices pm.fx(cmn) = pm0(cmn) ; pe.fx(cen) = pe0(cen) ; pwe.fx(cedn) = pwe.l(cedn) ; e.fx(cen) = 0; m.fx(cmn) = 0; fdsc.fx(f,a)$(wfdist(f,a) eq 0) = 0 ; *########################### model closure ############################# *## foreign exchange market closure * in this version, the balance of trade (current account balance) is * fixed exogenously and the exchange rate is the equilibrating variable. * exr.fx = exr.l ; fsav.fx = fsav.l ; remit.fx = remit.l ; fbor.fx = fbor.l ; *## investment-savings closure * this version specifies neoclassical closure. aggregate investment is * determined by aggregate savings; the model is savings driven. * KT since there are three HH, only one should be endogenous, or investment should be * To generalize (for code with any number of HH), assign one HH to be used * in closure Set hhclose(hh) /HOUS/ ; * mps.fx(hh) = mps.l(hh) ; mps.fx(hh)$(NOT hhclose(hh)) = mps.l(hh) ; invest.fx = invest.l ; iadj.fx = iadj.l ; *## exogenous govt expenditure *## and govt closure rule * real government spending (gdtot) is fixed exogenously. the government * deficit (govsav) is determined residually. gent.fx = gent.l ; hht.fx = hht.l ; gadj.fx = gadj.l ; * govsav.fx = govsav.l ; *## factor market closure * in this version, all factors, including capital, are mobile. * commented equations allow a version with fixed wage for labor. * the model then solves for aggregate employment. fs.fx(f) = fs.l(f) ; * wf.fx("labor") = wf.l("labor") ; * fs.lo("labor") = -inf ; * fs.up("labor") = +inf ; *## numeraire price index *in this case, the gnp deflator. pindex.fx = pindex.l ; *########################### end of model ############################ options iterlim=1000,limrow=0,limcol=0,solprint=off; model TUG /all/ ; solve TUG using mcp; display px.l, px0, pa.l, pa0, pk.l, pk0, pd.l, pd0, pe.l, pe0, pm.l, pm0 ; display walras.l ; display exr.l, exr0 ; display hhsav0, hhsav.l, savings.l, govsav0, govsav.l, fsav0, fsav.l, entsav0, entsav.l, tothhtax.l, tothhtax0, yh.l, yh0, yinst0, yinst.l, mps.l, mps0, p0, p.l, saltax.l ;