Structural
Reinforcement Learningfor Heterogeneous Agent Macroeconomics
Global solutions from simulated equilibrium prices.
* Equal contribution
gt, zt
Full distribution.
Rich aggregate dynamics.
st, zt, pt
Own state. Aggregate shocks.
Low-dimensional prices.
01 / The method
Sidestep the Master equation.
Keep the economy’s heterogeneity. Change the state representation used to make decisions.
In heterogeneous-agent models with aggregate risk, equilibrium prices generally depend on the full cross-sectional distribution. Tracking that distribution as a state variable creates a high-dimensional Master equation.
SRL works with a low-dimensional policy π(s, z, p) and evaluates lifetime utility along simulated equilibrium price paths. It combines reinforcement learning with structural knowledge of individual dynamics.
- 01
Use the structure you know.
Budget constraints and idiosyncratic transitions are encoded in the policy-dependent transition matrix Aπ. Differentiate the simulated objective through these known individual dynamics.
- 02
Sample equilibrium price paths.
Simulate aggregate shocks and prices to estimate expected lifetime utility. Policies double as demand schedules, so markets can clear along each rollout, including under a candidate policy.
- 03
Improve the policy, taking prices as given.
Structural policy gradient updates the low-dimensional policy. A stop-gradient through price formation implements competitive price-taking; the individual does not internalize its effect on equilibrium prices.
With the restricted decision state, the equilibrium concept is a sequential restricted perceptions equilibrium. The full distribution continues to evolve in the environment. Policies can also be extended to condition on price histories.
Inside the structural policy gradient
Known individual transitions carry the gradient; simulated aggregate histories supply the price paths. Monte Carlo sampling still introduces uncertainty in the estimated objective.
02 / Benchmark results
A familiar benchmark.
Closely matched dynamics.
In the Krusell–Smith model, compare SRL with a full rational-expectations solution computed using DeepHAM.
Global solutions, in seconds to minutes.
The same method handles implicit market clearing in Huggett, forward-looking price setting in HANK, and portfolio choice with two endogenous asset prices.
JAX implementation on a single NVIDIA A100 GPU in Google Colab. Reported times are means over 10 runs, from the slides’ computational experiments.
| Model | Time | Seconds |
|---|---|---|
| Krusell–Smith | 37 sec | 36.77 |
| Huggett + aggregate risk | 46 sec | 45.91 |
| HANK + aggregate risk | 4.1 min | 246.49 |
| Huggett + portfolio choice | 9.3 min | 559.50 |
Huggett partial-equilibrium reference: 24.50 seconds. Tutorial runtimes depend on the notebook and hardware; see the repository.
03 / Portfolio choice
Two assets.
Two market-clearing prices.
Extend Huggett with a risk-free bond and a risky stock. Both asset prices are pinned down by market clearing.
Individual policies determine asset demand. Aggregating across households yields demand schedules for both markets; their intersection identifies the joint clearing prices.
Joint market clearing
Bond market
Equity market
Portfolio-choice results and the SSJ comparisons below are presented in the newer slides; the linked working paper is the March 2026 version.
Household policies and the cash-on-hand distribution
Consumption
Equity share
Cash-on-hand distribution
04 / Global and local solutions
Where nonlinearities matter.
The portfolio example illustrates differences between SRL and first-, second-, and third-order sequence-space approximations.
A global comparison beyond small shocks.
In the two-asset model, local approximations can deviate materially from the SRL solution as the aggregate shock moves away from the steady state. Higher approximation order does not uniformly close the gap in this example.
0.13%
Reported average SRL Euler equation error,
as a share of consumption.
Top panels: asset-price responses. Bottom panels: percentage deviations from SRL. Solid and dashed SRL curves distinguish the shock-volatility specifications shown in the original legend.
The one-asset benchmark is different.
In the one-asset Huggett example, the sequence-space approximations and SRL are closely aligned over the displayed shock range. The lower panels make the small remaining deviations visible.
0.096%
Reported average SRL Euler equation error
for the one-asset example in the slides.
These are different model experiments with different shock ranges and specifications. Switching views compares their findings, rather than holding the calibration fixed.
05 / Further validation
What changes the learned policy?
Inspect how a richer price history affects consumption policies.
Does adding a lagged price change decisions?
Richer price information.
In the Huggett experiment, allowing the policy to condition on one lagged bond price changes consumption policies only slightly over the displayed states.
This is an empirical robustness check in the benchmark, rather than a general result that current prices are sufficient in every economy.
06 / Learn by building
From the household problem
to aggregate risk.
Seven pedagogical JAX notebooks introduce one idea at a time. Start with familiar value function iteration, then build up to structural RL.
The same problem, by policy gradient
Maximize lifetime utility by automatic differentiation.
Huggett without aggregate risk
Clear the bond market inside the simulated environment.
Huggett with Epstein–Zin preferences
Separate risk aversion and intertemporal substitution.
Each notebook can run in Google Colab or locally. The repository is a tutorial implementation, rather than the complete replication package for every experiment on this page.
Read the full syllabus07 / Read & cite
Explore the research.
The working paper develops the framework and benchmark experiments. The slides also cover the portfolio-choice extension and comparisons with higher-order SSJ.
Cite SRL
@misc{SRL,
title = {Structural Reinforcement Learning for
Heterogeneous Agent Macroeconomics},
author = {Yucheng Yang and Chiyuan Wang and
Andreas Schaab and Benjamin Moll},
year = {2025},
eprint = {2512.18892},
archivePrefix = {arXiv},
primaryClass = {econ.TH},
url = {https://arxiv.org/abs/2512.18892}
}