Solving Dynamic Models with Heterogeneous Agents and Aggregate Uncertainty with Dynare or Dynare++
uncertainty can be solved using Dynare or Dynare++ software that implements a perturbation approach. When the explicit aggregation algorithm (XPA) is used to obtain aggregate laws of motion, this can be accomplished by combining a Dynare program with a very simple Matlab program. When the Krusell-Smith algorithm is used, then the Matlab program needed is somewhat more involved, but still relatively simple. We calculate and compare first and second-order numerical solutions using both algorithms. These numerical procedures are also compared with the algorithm that solves the individual policy rules with a projection instead of a perturbation procedure. Finally, we discuss a procedure that efficiently chooses which cross-sectional moments to include as aggregate state variables when nonlinearities are important and the mean is not a sufficient statistic.