Macro Paper Warehouse
Published Classic [Quantitative Economics] doi:10.3982/qe2190 Online 1 Jan 2026 · Issue Jan 2026 Vol. 17, No. 2, pp. 297-341

DeepHAM: A global solution method for heterogeneous agent models with aggregate shocks

Jiequn Han — Flatiron Institute and Princeton University

Yucheng Yang — Princeton University

Weinan E — Peking University and Princeton University

📄 Summarized from the full manuscript · Human-reviewed for faithfulness before publication

In brief

Solving models where households differ and share aggregate shocks forces a choice: one classic method handles many shocks but not sharp nonlinearities like a zero interest-rate floor; another handles nonlinearities but not much heterogeneity. This paper trains computer networks on simulated economic histories, summarizing the population with self-learned statistics, to get both at once. In a classic savings-and-borrowing test economy, it cuts the solution error by roughly a third to two-fifths versus the older method, and shows a purely redistributive policy shock changes untouched middle-income households' welfare -- invisible to the older method. The same approach solves a planner's best-policy problem as easily as an ordinary market outcome.

What this paper finds — and why it matters

Solving heterogeneous-agent (HA) models with aggregate shocks efficiently, reliably, interpretably, and generally has proven difficult: the Krusell-Smith (KS) method approximates the distribution with a small number of moments and is efficient for simple models but suffers a curse of dimensionality with multiple shocks or endogenous states, while the local-perturbation method of Reiter (2009) handles complex models but is unreliable wherever aggregate shocks generate nonlinear or nonlocal effects (a zero lower bound, large shocks, or a risky steady state that departs from the deterministic one). This paper’s method, DeepHAM, is designed to satisfy all four requirements – efficiency, reliability, interpretability, and generality – at once. It represents each agent’s value and policy functions with deep neural networks, and, rather than feeding these networks the entire cross-sectional distribution, first extracts a small number of “generalized moments”: neural-network-determined, permutation-invariant summary statistics of the distribution that play a role analogous to classical moments (such as the first moment of wealth) but are automatically optimized rather than fixed a priori. The networks are trained by directly optimizing the model’s objective over simulated economic paths, sidestepping the fixed-point iterations that both KS-style and Reiter-style methods require. In a calibrated Krusell-Smith benchmark, DeepHAM using only the first moment already reduces the Bellman equation error by 27.2% relative to the classic KS solution, and DeepHAM with one algorithmically-optimized generalized moment reduces the error by 40.3%; the resulting generalized moment reveals that the mapping from individual wealth to the moment is concave, implying that a purely redistributive, unanticipated policy shock changes the welfare of “middle” households who are not part of the redistribution program – a channel invisible to the standard KS solution, in which welfare depends only on the first moment. DeepHAM also efficiently solves more complex environments, including a model with a Brunnermeier-Sannikov-style financial sector, without suffering the curse of dimensionality that afflicts moment-matching or discretized state-space methods as the number of shocks or endogenous states grows. Finally, because DeepHAM’s neural networks are trained directly against a stated objective rather than derived from a decentralized equilibrium concept, the same framework solves the planner’s constrained-efficiency problem as easily as the competitive equilibrium, which the authors note “opens up new possibilities for studying optimal monetary and fiscal policies in heterogeneous agent models with aggregate shocks.” The paper’s stated scope excludes models in which aggregate variables are determined recursively as a function of expected future aggregate variables (such as inflation in a forward-looking New Keynesian Phillips curve), which the authors flag as requiring an additional price function and leave for companion work.

Summary of a classic paper, AI-assisted and human-reviewed. See the linked original for the authoritative claims and full conditions.


Questions & answers

Q1. What four requirements does the paper set out for an ideal HA solution method, and how do existing methods fall short?

The paper specifies efficiency (computationally tractable for complex models with multiple state variables), reliability (accurate beyond the local perturbation regime, capturing nonlinear/nonlocal effects), interpretability (an interpretable representation of the state distribution, not just numerical output), and generality (applicable to a wide variety of models and to both competitive-equilibrium and constrained-efficiency notions) (Introduction, pp. 2-3). As summarized in Table 1 (p. 3), the Krusell-Smith method handles multiple shocks and multiple endogenous states but not large shocks, risky steady states, or nonlinearities such as the ZLB; the perturbation method of Reiter (2009) handles the latter three but not the former two. DeepHAM is proposed as satisfying all five model features simultaneously.

Q2. What is a “generalized moment,” and how does it differ from a classical Krusell-Smith moment?

Generalized moments “extract useful information from the state distribution, similarly to classical moments, but are represented by neural networks and automatically determined by the algorithm,” and their introduction “ensures that the agent’s optimal policy and value functions are invariant under permutations of the ordering of the agents” (Introduction, p. 4). Unlike a fixed choice such as the first moment of the wealth distribution, the mapping from individual states to the generalized moment is learned jointly with the value and policy functions, so it can capture whichever features of the distribution matter most for the model’s equilibrium dynamics and welfare.

Q3. By how much does DeepHAM improve solution accuracy in the baseline Krusell-Smith comparison?

“Compared to the KS method, DeepHAM with the first moment in the state vector reduces the Bellman equation error by 27.2%. DeepHAM with one generalized moment reduces the error by 40.3%” (section 3.2.1, p. 21, Table 2). The paper notes the KS method with the first moment already “solves the Krusell-Smith model reasonably well,” so these are accuracy improvements on top of an already-workable baseline, and a simulated economy based on the DeepHAM solution remains highly consistent with one based on the KS solution, further confirming DeepHAM’s accuracy.

Q4. What does the generalized moment reveal about redistributional policy that the classical Krusell-Smith solution misses?

“We find that the basis function is concave in the individual asset, while the value function is linear with regard to the generalized moment. That is, households with different levels of wealth will have heterogeneous contributions to the generalized moment: giving an additional unit of assets to poor households increases the generalized moment more than giving the same assets to rich households” (section 3.2.2, p. 21). Consequently, an unanticipated one-time redistribution from the richest to the poorest households lowers the generalized moment’s implied future path of aggregate savings-driven wage and return dynamics enough to make “middle” households (who receive more capital income than labor income under the calibration) worse off on impact – a result “sensible” in economic logic but one that “differs from the implications of the solution of the KS method,” under which households’ welfare depends only on the (unchanged) first moment, so the same redistribution would have no instantaneous welfare effect on middle households at all (pp. 21-22).

Q5. Why can DeepHAM solve the constrained-efficiency problem “as easily as” the competitive equilibrium?

Because DeepHAM trains its neural-network value and policy functions by directly optimizing a stated objective over simulated paths rather than by characterizing a decentralized market equilibrium, the same procedure applies whether that objective is an individual household’s utility (competitive equilibrium) or a planner’s welfare criterion subject to the same resource constraints (constrained efficiency) – a problem “regarded as a challenging problem in the literature” (Introduction, pp. 4-5). The authors highlight this as “a significant advantage over existing methods” and note it “open[s] up new possibilities for studying optimal monetary and fiscal policies in heterogeneous agent models with aggregate shocks” (Conclusion).

Q6. What broader class of models does the paper argue DeepHAM should extend to, and what is explicitly excluded?

The paper lists as natural extensions models with richer portfolio choice (housing, mortgages), ex ante heterogeneous agent types (households and financial experts as in Brunnermeier and Sannikov 2014, or rational and bounded-rational agents), rich firm heterogeneity, multiple DSGE-style shocks, large shocks such as COVID-19, and asset-pricing/wealth-effects applications (Introduction, pp. 4-5). It explicitly excludes, for now, “HA models with aggregate variables that are determined recursively as a function of expected future aggregate variables: the inflation rate in a New Keynesian Phillips curve (NKPC), for example, or indirect utility under Epstein-Zin preferences,” noting that “handling forward-looking equilibrium conditions in global solution methods is crucial in solving HANK models with aggregate shocks and requires an additional price function,” which the authors leave “for further discussion in a companion paper” (Conclusion).

Q7. How does DeepHAM’s neural-network approach differ from other deep-learning-based HA solution methods cited in the paper?

DeepHAM differs from “existing literature that uses deep learning to represent high dimensional policy and value functions directly (Maliar et al., 2021; Azinovic et al., 2022)” by introducing generalized moments to represent the state distribution efficiently and solving for value and policy functions as functions of those moments instead (Introduction, p. 4, and fn. 1). Compared to the independent, contemporaneous work of Kahou et al. (2021), which shares the idea of permutation-invariant generalized moments, DeepHAM further explores the economic interpretation of the generalized moments and uses them to study a redistributional policy shock; compared to Maliar et al. (2021), DeepHAM optimizes directly over simulated paths rather than a weighted sum of the Bellman residual and first-order condition, avoiding the need to accurately approximate partial derivatives of a high-dimensional value function.

Q8. What was the original identity of this paper on the syllabus, and why does its record here differ?

The Econ 234 syllabus cites this paper by its arXiv preprint identifier (arXiv:2112.14377, first circulated December 2021), reflecting its status as a widely-read working paper for several years. Crossref and OpenAlex records confirm it has since been formally published as Han, Jiequn, Yucheng Yang, and Weinan E, “DeepHAM: A global solution method for heterogeneous agent models with aggregate shocks,” Quantitative Economics 17(2), pp. 297-341 (DOI 10.3982/QE2190), an open-access (“diamond” OA) Econometric Society journal. This record uses the published journal DOI as its primary identifier, consistent with this warehouse’s convention of preferring a paper’s final published venue once one exists, while retaining the arXiv and SSRN identifiers as preprint_ids. The working-paper text (arXiv v2, February 2022) is the source used for this summary, since it is freely available and, based on the abstract and structure matching the published version, materially unchanged in substance.

Key terms in this paper

Definitions below follow the paper's own usage.

Generalized moments
A set of scalar summaries of the cross-sectional distribution, analogous to classical moments but represented and automatically determined by neural networks rather than fixed in advance. Generalized moments "extract useful information from the state distribution" and, crucially, ensure the agent's value and policy functions are invariant to permutations of the ordering of agents, letting DeepHAM reduce a high-dimensional distributional state to a low-dimensional but flexible, interpretable summary (Introduction, pp. 3-4).
DeepHAM (Deep learning-based algorithm for Heterogeneous Agent Models)
DeepHAM's overall algorithm: value and policy functions are represented by deep neural networks taking the generalized moments (rather than the full distribution) as arguments, and these networks are trained by directly optimizing an objective evaluated on simulated economic paths, rather than by solving a fixed point over a discretized state space as in the Krusell-Smith or Reiter-style approaches (Introduction, pp. 2-4).
Model-feature comparison of solution methods
The paper's comparison table of solution methods against five desired model features -- multiple shocks, multiple endogenous states, large shocks, a risky steady state distinct from the deterministic steady state, and nonlinearity such as an occasionally-binding zero lower bound -- showing the Krusell-Smith method handles the first two but not the last three, linear perturbation (Reiter 2009) handles the last three but not the first two, and DeepHAM is designed to handle all five simultaneously (Introduction, Table 1, p. 3).
Redistributional welfare effects invisible to the first-moment approximation
A worked finding in the Krusell-Smith model (section 3.2.2) that, once the state distribution is summarized by one generalized moment rather than just its first moment, the basis function mapping individual assets to the generalized moment is concave, so "giving an additional unit of assets to poor households increases the generalized moment more than giving the same assets to rich households." As a result, an unanticipated one-time redistribution from the richest to the poorest households lowers the welfare of "middle" households not part of the program (because it raises future aggregate savings, lowering future returns on which they rely) -- an effect the standard Krusell-Smith solution, which makes welfare depend only on the first moment, cannot detect.
Constrained efficiency solved as easily as competitive equilibrium
A capability the paper demonstrates as evidence of DeepHAM's generality: because value and policy functions are learned directly from simulated objectives rather than derived from a fixed decentralized equilibrium concept, the same machinery solves a planner's constrained-efficiency problem "as easily as it solves the competitive equilibrium" (Abstract), which the paper notes "opens up new possibilities for studying optimal monetary and fiscal policies in heterogeneous agent models with aggregate shocks."
How this summary was made. Bibliographic fields are pulled from Crossref and OpenAlex and are not model-generated. The summary was drafted from the open-access manuscript , checked by a claim-grounding and calibration review pass, and approved before publishing. Found an error or a misrepresentation? Flag it here — corrections are welcome, especially from the authors.