\$TITLE Ramsey Model -- MPSGE formulation calibrated to base year data \$if not set plots \$set plots yes \$if not exist "%gams.sysdir%wgnuplot.exe" \$set plots no * Define the time horizon of the model using two sets, one which * includes the post-terminal year and one which covers only the * endogenous years: SET tt Time horizon (with the first year of the post-terminal period) /2004*2081/, t(tt) Time period over the model horizon /2004*2080/, t0(t) Year 0, tl(tt) Last endogenous year, tp(tt) First post-terminal year; \$ontext Calibrate to the steady-state condition: I0 = KD0 * (g + delta) / (r + delta) where g=2, delta=7, r=5, so I0 = 48 * 9 / 12 = 36 Here is the benchmark (steady-state) social accounting matrix: Y I FD P 100 -36 -64 PL -52 52 RK -48 48 PS 36 -36 \$offtext PARAMETER g Growth rate /0.02/, r Interest rate /0.05/, delta Depreciation rate /0.07/, kvs Capital value share /0.48/, y0 Base year output, kd0 Base year rental value of capital, k0 Base year capital stock, i0 Base year investment, c0 Base year consumption, l0 Base year labor input, kstock Base year capital stock multiplier /1/, taxk(t) Capital tax rate in period T, qref(t) Reference quantity path, pref(tt) Reference price path; * Use the GAMS ORD (ordinality) and CARD (cardinality) * functions to automate the identification of the first * and last periods of the model horizon: t0(t) = yes\$(ord(t) eq 1); tl(t) = yes\$(ord(t) eq card(t)); loop(tl(tt), tp(tt+1) = yes;); * Calibrate the model to the baseline growth path: y0 = 100; kd0 = kvs * y0; l0 = y0 - kd0; k0 = kd0 / (r + delta); i0 = (g + delta) * k0; c0 = y0 - i0; taxk(t) = 0; qref(t) = (1+g)**(ord(t)-1); pref(tt) = (1/(1+r))**(ord(tt)-1); DISPLAY y0, kd0, l0, k0, i0, c0, g, r, delta; \$ONTEXT \$MODEL:RAMSEY \$SECTORS: Y(t) ! Output I(t) ! Investment K(t) ! Capital stock \$COMMODITIES: P(t) ! Output price RK(t) ! Return to capital PK(tt) ! Capital price PL(t) ! Wage rate \$CONSUMERS: RA ! Representative agent \$AUXILIARY: TK ! Post-terminal capital stock \$PROD:Y(t) s:1 O:P(t) Q:Y0 I:PL(t) Q:L0 I:RK(t) Q:KD0 A:RA T:TaxK(t) \$PROD:K(tt)\$T(tt) O:PK(TT+1) Q:(K0*(1-DELTA)) O:RK(tt) Q:KD0 I:PK(tt) Q:K0 \$PROD:I(tt)\$T(tt) O:PK(TT+1) Q:I0 I:P(tt) Q:I0 \$DEMAND:RA s:1 D:P(t) Q:(qref(t)*C0) P:pref(t) E:PL(t) Q:(L0*qref(t)) E:PK(T0) Q:(K0*KSTOCK) E:PK(TP) Q:-1 R:TK \$REPORT: V:C(t) D:P(t) DEMAND:RA V:W W:RA \$CONSTRAINT:TK SUM(T\$TL(T+1), I(T+1)/I(t) - Y(T+1)/Y(t)) =E= 0; \$OFFTEXT \$SYSINCLUDE mpsgeset RAMSEY * Assign steady-state equilibrium values for quantities * and prices: Y.L(t) = qref(t); I.L(t) = qref(t); K.L(t) = qref(t); P.L(t) = pref(t); RK.L(t) = pref(t); PL.L(t) = pref(t); * The steady-state price of capital is the output price * times one plus the interest rate: PK.L(tt) = (1+r) * pref(tt); TK.L = k0 * (1+g)**card(t); RAMSEY.ITERLIM = 0; \$INCLUDE RAMSEY.GEN SOLVE RAMSEY USING MCP; ABORT\$(RAMSEY.OBJVAL > 0.001) "Model does not calibrate."; RAMSEY.ITERLIM = 10000; * Apply a tax on capital inputs of 25% beginning in year 6: TAXK(t)\$(ORD(t) > 5) = 0.25; \$INCLUDE RAMSEY.GEN SOLVE RAMSEY USING MCP; * Generate some reports with graphs: PARAMETER indices "Consumption, Investment and Capital Stock Indices"; indices(t,"C") = C.L(t)/(c0*qref(t)); indices(t,"I") = I.L(t)/qref(t); indices(t,"K") = K.L(t)/qref(t); DISPLAY INDICES; * Define the domain over which the X-axis will be defined: \$setglobal domain t * Define the labels to be printed along the X axis: set tlbl(t) Time periods to be labelled in output plots /2010,2030,2050,2070/; \$setglobal labels tlbl * Place the key to the figures outside the graph (see GNUPLOT 3.7 Help File): \$setglobal gp_opt0 "set key outside" * Plot the graph with horizonal and vertical grid lines (see GNUPLOT 3.7 Help File): \$setglobal gp_opt1 "set grid" * Generate the plot to the screen -- it can subsequently be copied to the clipboard * using a right-click of the mouse, and then pasted into a separate program for * publication: \$if %plots%==yes \$libinclude plot indices * Repeat the report generation process a couple more times: parameter price "Capital prices and wage rate"; price(t,"RK") = RK.L(t)/P.L(t); price(t,"PK") = PK.L(t)/((1+r)*P.L(t)); price(t,"PL") = PL.L(t)/P.L(t); \$if %plots%==yes \$libinclude plot price parameter grates(tt,*) Growth rates through the transition; grates(t,"c") = 100 * (C.l(t+1)/C.l(t) - 1); grates(t,"i") = 100 * (I.l(t+1)/I.l(t) - 1); grates(t,"k") = 100 * (K.l(t+1)/K.l(t) - 1); set gs /c,i,k/; grates(tl,gs) = na; \$if %plots%==yes \$libinclude plot grates