DeepHAM: A Global Solution Method for Heterogeneous Agent Models with Aggregate Shocks

Jiequn Han, Yucheng Yang, Weinan EarXiv 2021

Abstract

An efficient, reliable, and interpretable global solution method, the Deep learning-based algorithm for Heterogeneous Agent Models (DeepHAM), is proposed for solving high dimensional heterogeneous agent models with aggregate shocks. The state distribution is approximately represented by a set of optimal generalized moments. Deep neural networks are used to approximate the value and policy functions, and the objective is optimized over directly simulated paths. In addition to being an accurate global solver, this method has three additional features. First, it is computationally efficient in solving complex heterogeneous agent models, and it does not suffer from the curse of dimensionality. Second, it provides a general and interpretable representation of the distribution over individual states, which is crucial in addressing the classical question of whether and how heterogeneity matters in macroeconomics. Third, it solves the constrained efficiency problem as easily as it solves the competitive equilibrium, which opens up new possibilities for studying optimal monetary and fiscal policies in heterogeneous agent models with aggregate shocks.

Introduction

In modern macroeconomics, the "Representative Agent" model is increasingly seen as insufficient. To understand the real world, researchers require Heterogeneous Agent (HA) models that account for the fact that agents—such as households with varying wealth levels—react differently to aggregate shocks like interest rate changes or recessions.

However, adding aggregate shocks to these models creates a massive computational challenge known as the "curse of dimensionality." The state of the economy is no longer defined by a few scalars but by the entire distribution of wealth and status across the population. Traditional approaches, such as the Krusell-Smith (KS) method or perturbation methods, often struggle with high-dimensional states, large shocks, or nonlinear constraints like the Zero Lower Bound (ZLB).

Comparison of model features supported by different solution methods.

As illustrated in the table above, DeepHAM is designed to overcome these limitations, providing a global solution that handles multiple shocks, large fluctuations, and nonlinearities that traditional methods cannot simultaneously address.

Methodology: The DeepHAM Architecture

DeepHAM (Deep learning-based algorithm for Heterogeneous Agent Models) utilizes three core pillars to solve complex macroeconomic systems:

  1. Generalized Moments: Instead of relying on simple summary statistics like mean wealth, DeepHAM uses a neural network to learn an "encoding" of the distribution. These generalized moments ($Q_t$) are permutation-invariant, allowing the model to represent the distribution as a whole without tracking specific individuals.
  2. Deep Neural Networks (DNNs): DNNs are employed to approximate value functions (long-term utility) and policy functions (decision rules). Unlike grid-based methods, the computational cost of DNNs does not increase exponentially with the number of dimensions.
  3. Pathwise Optimization: The algorithm optimizes over simulated economic paths rather than a fixed grid. It updates value functions via supervised learning and optimizes policy functions using a "fictitious play" approach, where agents optimize strategies assuming others follow established rules.

Key Results and Performance

The effectiveness of DeepHAM was evaluated using benchmark models including the classic Krusell-Smith (1998) model, a complex financial sector model, and the Aiyagari model for social planning problems.

Accuracy and Speed

  • Superior Accuracy: In the baseline Krusell-Smith model, DeepHAM reduced the Bellman equation error by 40.3% compared to the standard KS method.
  • Computational Efficiency: For the constrained efficiency problem in an Aiyagari model, DeepHAM achieved a solution in 20 minutes on a small GPU cluster, compared to 15 hours for classical methods on a laptop.
  • Scalability: The method effectively bypasses the curse of dimensionality; solving a complex model with a financial sector and continuous shocks took only 12% longer than solving the simple baseline model.

Economic Insights

DeepHAM demonstrates that "approximate aggregation"—the assumption that only mean wealth matters—is often insufficient. The model shows that redistribution shocks (e.g., shifting wealth from the rich to the poor) significantly impact the welfare of the middle class even when mean wealth remains constant, a nuance captured by the algorithm's generalized moments.

Conclusion and Future Work

DeepHAM offers a robust, scalable framework for solving HA models, making social planner problems as accessible as market equilibria. While the current version assumes explicit functional forms for aggregate prices, future iterations aim to incorporate recursive aggregate variables, such as inflation in New Keynesian models, and develop estimation algorithms to fit these models to empirical data.

Summary updated

BibTeX
@misc{han2021deepham,
  author = {Jiequn Han and Yucheng Yang and Weinan E},
  title = {{DeepHAM: A Global Solution Method for Heterogeneous Agent Models with Aggregate Shocks}},
  year = {2021},
  eprint = {2112.14377},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.14377},
}
Figure