DSGE Modeling ============= A Markov-switching DSGE in the modern toolbox is a forward-looking nonlinear system .. math:: E_t f(y_{t+1}, y_t, y_{t-1}, \varepsilon_t, p(r_t)) = 0, with :math:`r_t = 1, 2, \dots, h` a Markov-chain regime, transition matrix :math:`Q_{i,j}(I_t)` that can be constant or endogenous, and a parameter vector :math:`p(r_t)` that can switch on one or more chains. The constant-parameter case is the trivial :math:`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: .. toctree:: :maxdepth: 2 Model file language Steady state and balanced-growth path First order perturbation Higher order perturbation Solving Optimal policy Optimized simple rules Occasionally-binding constraints Deterministic and quasi-deterministic solutions Heterogeneous agents Very large models Automatic translation of files