UPDATE: Consider looking at https://github.com/jeromematthewcelestine/hadsge for Reiter-method code instead.
Demonstration of the Reiter method for solving a model with heterogeneous agents and aggregate shocks in general equilibrium. Solves a simple model of firm investment with persistent aggregate and idiosyncratic productivity shocks.
Reiter (2009), Journal of Economic Dynamics & Control, Solving heterogeneous-agent models by projection and perturbation.