1. DSGE Modeling
A Markov-switching DSGE in the modern toolbox is a forward-looking nonlinear system
\[E_t f(y_{t+1}, y_t, y_{t-1}, \varepsilon_t, p(r_t)) = 0,\]
with \(r_t = 1, 2, \dots, h\) a Markov-chain regime, transition matrix \(Q_{i,j}(I_t)\) that can be constant or endogenous, and a parameter vector \(p(r_t)\) that can switch on one or more chains. The constant-parameter case is the trivial \(h = 1\) special case of the same engine; there is no separate constant-parameter code path.
The modern toolbox builds a DSGE via the dsge_model factory.
Once you have the object, solve, filter, estimate,
forecast, simulate, irf and the decompositions operate
on it directly. The rest of this chapter covers the DSGE-specific
machinery, one section at a time:
- 1.1. Model file language
- 1.2. Zero-th order approximation: steady state and balanced-growth path
- 1.3. First-order perturbation
- 1.4. Higher-order perturbation
- 1.5. Solving
- 1.5.1. The signature
- 1.5.2. The retcode pattern
- 1.5.3. Picking a solver
- 1.5.4. Solver options
- 1.5.5. Order of approximation
- 1.5.6. Optimal policy
- 1.5.7. Occasionally-binding constraints
- 1.5.8. Perturbation strategy
- 1.5.9. Other options worth knowing
- 1.5.10. The diagnostic protocol when solve fails
- 1.5.11. Return-code reference
- 1.5.12. The retcode-aware pattern
- 1.6. Optimal policy
- 1.6.1. The modern distinctive
- 1.6.2. Declaring the planner’s problem
- 1.6.3. Solve-time choices
- 1.6.4. Solver selection
- 1.6.5. Loose commitment and stochastic replanning
- 1.6.6. A worked example: Tatiana’s monetary-fiscal game
- 1.6.7. Nonstationary optimal policy: geometric multipliers
- 1.6.8. Where to look next
- 1.7. Optimal (optimized) simple rules
- 1.8. Occasionally-binding constraints
- 1.9. Deterministic and quasi-deterministic solutions
- 1.10. Heterogeneous agents (HANK)
- 1.11. Very large models
- 1.12. Automatic translation of files