Abstract
Agent-Based Models (ABMs) are used in several fields to study the evolution of complex systems from micro-level assumptions. However, a significant drawback of ABMs is their inability to estimate agent-specific (or "micro") variables, which hinders their ability to make accurate predictions using micro-level data. In this paper, we propose a protocol to learn the latent micro-variables of an ABM from data. We begin by translating an ABM into a probabilistic model characterized by a computationally tractable likelihood. Next, we use a gradient-based expectation maximization algorithm to maximize the likelihood of the latent variables. We showcase the efficacy of our protocol on an ABM of the housing market, where agents with different incomes bid higher prices to live in high-income neighborhoods. Our protocol produces accurate estimates of the latent variables while preserving the general behavior of the ABM. Moreover, our estimates substantially improve the out-of-sample forecasting capabilities of the ABM compared to simpler heuristics. Our protocol encourages modelers to articulate assumptions, consider the inferential process, and spot potential identification problems, thus making it a useful alternative to black-box data assimilation methods.
Introduction
Agent-Based Models (ABMs) are powerful tools for studying complex systems—from pandemic spreads to economic shifts—by simulating the actions of individual agents. However, they face a persistent "data problem." While researchers often have access to aggregate macro-data (e.g., neighborhood house prices), the internal states of individual agents (e.g., household incomes) remain largely unobserved.
Because these "micro" variables are latent, modelers typically initialize them using heuristics or random guesses. This mismatch often causes simulations to diverge from reality, limiting the quantitative forecasting utility of ABMs. This paper introduces a framework to transform traditional ABMs into "learnable" probabilistic models, allowing for the direct inference of hidden micro-states from observed macro-data.
Methodology: Making ABMs Learnable
The proposed protocol bridges the gap between simulation and statistical inference through a three-step process:
- Translation: A standard ABM is translated into a probabilistic model by simplifying complex rules into a computationally tractable likelihood function.
- Estimation: A Generalized Expectation-Maximization (EM) algorithm is employed. The E-step evaluates the likelihood of agent behaviors, while the M-step uses online gradient descent to update estimates of initial latent variables.
- Iteration: The process repeats over multiple epochs to account for temporal dependencies across the entire time series.
To facilitate this, "Learnable ABMs" should adhere to two design principles: Stochasticity Parsimony (limiting randomness to variables with available data) and Differentiability Preference (replacing discrete logic with continuously differentiable functions to enable gradient-based optimization).
Experimental Setup
The framework was evaluated using synthetic data traces from a housing market ABM. Synthetic data provides a "ground truth" for latent variables—such as the specific income of every household—which is impossible to obtain in real-world datasets. The setup simulated a city with five neighborhoods and three income classes over 20–25 time steps.
Key Results and Insights
The algorithm demonstrated high fidelity in reconstructing observed data, achieving an $R^2$ of 0.95 for prices and 0.74 for transaction volumes. Notably, the "Learnable" approach significantly outperformed standard benchmarks in out-of-sample forecasting, yielding much lower Root Mean Squared Error (RMSE) for both prices and transaction counts compared to random or proportional initialization methods.
A key insight is the difference in reconstructing "flow" vs. "stock" variables. The algorithm was more effective at reconstructing flow variables (current buyers, $R^2 \approx 0.74$) than stock variables (total population, $R^2 \approx 0.28$). This is attributed to the accumulation of errors in initial population estimates over time, whereas transactions are more directly coupled with current observed prices. Furthermore, this probabilistic approach helps identify "identification problems," where different micro-level configurations yield identical macro-results, clarifying the limits of available data.
Conclusion and Future Directions
While promising, the current process of translating standard ABMs into learnable ones is manual and hand-curated. Future work aims to automate this translation and scale the approach to models involving millions of agents using differentiable programming frameworks. Additionally, testing the robustness of this method against the inherent noise of real-world economic data remains a critical next step. By moving away from "black-box" simulations, this protocol provides a principled way to ground ABMs in empirical data while maintaining their underlying causal logic.
Summary updated