Policymakers need quantitative as well as qualitative answers to pressing policy questions. Because of advances in computational methods, quantitative estimates are now derived from coherent nonlinear dynamic macroeconomic models embodying measures of risk and calibrated to capture specific characteristics of real-world situations. This text shows how such models can be made accessible and operational for confronting policy issues. The book starts with a simple setting based on market-clearing price flexibility. It gradually incorporates departures from the simple competitive framework in the form of price and wage stickiness, taxes, rigidities in investment, financial frictions, and habit persistence in consumption. Most chapters end with computational exercises; the Matlab code for the base model can be found in the appendix. As the models evolve, readers are encouraged to modify the codes from the first simple model to more complex extensions. Computational Macroeconomics for the Open Economy can be used by graduate students in economics and finance as well as policy-oriented researchers.

Macroeconomic Correlations 167 Sensitivity Analysis 168 Concluding Remarks 170 Computational Exercise: Dunlop-Tarshis Puzzle 171 Habit Persistence 173 10.1 A DSGE Model with Habit Persistence 174 10.1.1 Household Sector 174 10.1.2 Production Sector 177 10.1.3 Government Sector 178 10.1.4 External Sector 179 10.1.5 Financial Sector 179 10.2 Solution Algorithm 180 10.2.1 Approximating Equations 180 10.2.2 Euler Errors 181 10.2.3 Accuracy Checks 181 10.3 Stochastic Simulations 181 10.3.1

shows that productivity has a positive effect on output and a negative effect on price, which then encourages more consumption. The improvement in productivity also results in a fall in labor and an increase in the real wage. Foreign debt initially increases with the fall in the trade balance (imports increase with the increase in production but exports remain ﬁxed). In this case the interest rate falls with the fall in price, and with the domestic rate less than the foreign 34 Chapter 2

Xt Þ: 3.3 ð3:21Þ Computational Analysis 3.3.1 Approximating Functions We have four decision rules, one for consumption C, one for the exchange rate S, and two for the price (one for the numerator A p1 , and one for the denominator A p2 ): C^t ¼ c c ðW c ; xt Þ; S^t ¼ c s ðW s ; xt Þ; p1 A^t ¼ c p1 ðW p1 ; xt Þ; p2 A^t ¼ c p2 ðW p2 ; xt Þ; xt ¼ fðZt À ZÞ; ðFt 1 À FÞ; ðRt 1 À RÞg: 54 Chapter 3 The state variables are the productivity, foreign debt, and interest rate. The approximating

Lt ð1 À t1 ÞWt ; ð6:4Þ Lt ¼ Ltþ1 bð1 þ Rt Þ; ð6:5Þ Lt St ¼ Ltþ1 bð1 þ RtÃ þ Ft þ Ft0 FtÃ ÞStþ1 ; " # 2 CðI À dK Þd CðI À dK Þ tþ1 t tþ1 t Qt ¼ Lt Ptk þ bQtþ1 ð1 À dÞ þ þ ; Kt 2Kt2 ð6:6Þ f Lt Pt ¼ Qt À Qt C ðIt À dKt 1 Þ : Kt 1 ð6:7Þ ð6:8Þ Compared to the earlier chapters, the model now includes two extra equations which contain the forward looking variable Q. Equations (6.7) and (6.8) show that the solutions for Qt , which determine investment and the evolution of capital, come from

essential to have a good strategy for developing a good dynamic stochastic general equilibrium (DSGE) model. As McCallum (2001) points out, it is desirable for a model to be consistent with both Introduction 3 economic theory and empirical evidence, but this ‘‘dual requirement’’ is only a starting point for consideration of numerous issues. McCallum also points out that ‘‘depicting individuals as solving dynamic optimization problems,’’ as is done in general equilibrium settings, is ‘‘useful