' This macro generates the variables with starting values ' Variables are identified by names. First two letters refer to ' variable type. Then J stands for "Japan" and U for "US" ' For some variables, final D denotes "demand", and S ' denotes "supply" create opecm u 1 200 smpl 1 200 genr xrj = 1 xrj.label(d) Exchange rate: units of J currency against 1 unit of U currency genr xru= 1/xrj xru.label(d) Exchange rate: units of U currency against 1 unit of J currency ' Bills genr BIJJd = 100 bijjd.label(d) Bills issued by J country acquired by J country: demand genr BIJJS = BIJJD bijjs.label(d) Bills issued by J country acquired by J country: supply genr BIJUD = 40 bijud.label(d) Bills issued by U country acquired by J country: demand genr BIJUS = BIJUD*xru bijus.label(d) Bills issued by U country acquired by J country: supply genr BIUJD = 40 biujd.label(d) Bills issued by J country acquired by U country: demand genr BIUJS = BIUJD*xrj biujs.label(d) Bills issued by J country acquired by U country: supply genr BIUUD = 40 biuud.label(d) Bills issued by U country acquired by U country: demand genr BIUUS = BIUUD biuus.label(d) Bills issued by U country acquired by U country: supply genr BIJS = BIJJS + BIUJS bijs.label(d) Bills issued by J country - total supply genr BIUS = BIJUS + BIUUS bius.label(d) Bills issued by U country - total supply ' Cash genr HMJD = 20 hmjd.label(d) Demand for cash of country J genr HMJS = HMJD hmjs.label(d) Supply of country J cash genr HMUD = 20 hmud.label(d) Demand for cash of country U genr HMUS = HMUD hmus.label(d) Supply of country U cash ' Govt expenditure and tax receipts genr GJ = 20 gj.label(d) Government expenditure in country J genr GU = 20 gu.label(d) Government expenditure in country U genr TJ = 20 tj.label(d) Tax revenue in country J genr TU = 20 tu.label(d) Tax revenue in country U genr thetaj = 0.2 thetaj.label(d) Tax rate in country J genr thetau = thetaj thetau.label(d) Tax rate in country U ' Consumption genr CJ = 80 cj.label(d) Consumption in country J genr CU = 80 cu.label(d) Consumption in country U ' Income and disposable income genr YJ = 100 yj.label(d) Income in country J genr YU = 100 yu.label(d) Income in country U genr YDJ = 80 ydj.label(d) Disposable income in country J genr YDU = 80 ydu.label(d) Disposable income in country U ' Trade genr XJ = 25 xj.label(d) Exports from country J to country U genr IMU = XJ imu.label(d) Imports of country U from country J genr XU = 25 xu.label(d) Exports from country U to country J genr IMJ = XU imj.label(d) Imports of country J from country U ' Stock of assets genr VJ = 100 vj.label(d) Net financial assets of country J genr VU = 100 vu.label(d) Net financial assets of country U ' Interest rates genr RBJ = 0.04 rbj.label(d) Interest rate on J country bills genr RBU = 0.04 rbu.label(d) Interest rate on U country bills ' Parameters in asset demand functions genr lam0 = 0.4 genr lam1 = 2 ' Parameters in consumption functions genr a1 = 0.8 genr a2 = 0.16 ' Parameters in import functions genr mu0u = -1.3863 genr mu1u = 1 genr mu2u = 0.2 genr mu0j = -1.3863 genr mu1j = 1 genr mu2j = 0.2 ' Create empty model OPEC1 model opec1 opec1.append @identity xrj=1/xru ' Supply of bills by $ govt to # households (demand determined opec1.append BIJUS = BIJUD*XRU ' Supply of bills by # govt to # households opec1.append BIJJS = BIJJD ' Govt budget for # opec1.append @identity BIUJS = BIUJS(-1)-d(BIJS)-d(HMJS)+GJ-TJ ' Supply of cash ($) opec1.append HMUS=HMUD opec1.append HMJS=HMJD ' Exchange rate closure opec1.append XRU=BIUJD/BIUJS ' Govt budget for $ opec1.append BIUS=BIUS(-1)-d(BIJUS)-d(HMUS)+GU-TU ' Income and wealth determination for $ opec1.append YU=CU+GU+XU-IMU opec1.append YDU = YU - TU +d(XRU)*BIUJS(-1) opec1.append VU=VU(-1)+YDU-CU ' Income and wealth determination for # opec1.append YJ=CJ+GJ+XJ-IMJ opec1.append YDJ = YJ - TJ + d(XRJ)*BIJUS(-1) opec1.append VJ=VJ(-1)+YDJ-CJ ' Array of asset demands opec1.append BIUUD=VU*(lam0+lam1*rbu-lam1*rbj) opec1.append BIUJD=VU*(lam0-lam1*rbU+lam1*rbj) opec1.append BIJJD=VJ*(lam0+lam1*rbj-lam1*rbu) opec1.append BIJUD=VJ*(lam0-lam1*rbj+lam1*rbu) opec1.append HMUD=VU-BIUUD-BIUJD opec1.append HMJD=VJ-BIJJD-BIJUD ' "Behavioural" for country U opec1.append TU=thetaU*YU opec1.append CU=a1*YDU+a2*VU(-1) opec1.append XU=IMJ*xru opec1.append log(IMU)=mu0u+mu1u*log(YU)+mu2u*log(xru) ' "Behavioural" for country J opec1.append TJ=thetaj*YJ opec1.append CJ=a1*YDJ+a2*VJ(-1) opec1.append XJ=IMU*xrj opec1.append log(IMJ)=mu0j+mu1j*log(YJ)+mu2j*log(xrj) ' Solve model for baseline opec1.scenario "Baseline" opec1.solve ' Shock to US govt. expenditure copy gu gu_base smpl 5 200 gu=gu+1 smpl 1 200 opec1.scenario "Scenario 1" opec1.solve ' Creates chart1 group chart1_g (yj_1/yj_0)*100 (yu_1/yu_0)*100 group chart2_g (XU_1-IMU_1)-(XU_0-IMU_0) xru_1/xru_0 group chart3_g (bijus_1/vj_1)/(bijus_0/vj_0) (bijud_1/vj_1)/(bijud_0/vj_0) smpl 1 40 freeze(chart1) chart1_g.line chart1.addtext(t) SHOCK TO $ GOVT. EXPENDITURE chart1.elem(1) legend(Jap Output) chart1.elem(2) legend(US Output) ' Creates chart2 freeze(chart2) chart2_g.line chart2.addtext(t) SHOCK TO $ GOVT. EXPENDITURE chart2.elem(1) legend(US Balance of trade) chart2.elem(2) legend(US Exchange rate) ' Creates chart3 freeze(chart3) chart3_g.line chart3.addtext(t) SHOCK TO $ GOVT. EXPENDITURE chart3.elem(1) legend(B#$s as share of V#) chart3.elem(2) legend(B#$d as share of V#) ' Shock to Jap govt.expenditure smpl 1 200 delete gu copy gu_base gu copy gj gj_base delete *_1 smpl 5 200 gj = gj+1 opec1.scenario "Scenario 1" opec1.solve ' Creates chart1b group chart1b_g (yj_1/yj_0)*100 (yu_1/yu_0)*100 group chart2b_g (XJ_1-IMJ_1)-(XJ_0-IMJ_0) xrj_1/xrj_0 group chart3b_g (biujs_1/vu_1)/(biujs_0/vu_0) (biujd_1/vu_1)/(biujd_0/vu_0) smpl 1 40 freeze(chart1b) chart1b_g.line chart1b.addtext(t) SHOCK TO # GOVT. EXPENDITURE chart1b.elem(1) legend(Jap Output) chart1b.elem(2) legend(US Output) ' Creates chart2b freeze(chart2b) chart2b_g.line chart2b.addtext(t) SHOCK TO # GOVT. EXPENDITURE chart2b.elem(1) legend(Jap Balance of trade) chart2b.elem(2) legend(Jap Exchange rate) ' Creates chart3b freeze(chart3b) chart3b_g.line chart3b.addtext(t) SHOCK TO # GOVT. EXPENDITURE chart3b.elem(1) legend(B$#s as share of V$) chart3b.elem(2) legend(B$#d as share of V$)