Neural parameter calibration for large-scale multiagent models

Thomas Gaskin, Grigorios A. Pavliotis, Mark Girolami

TL;DR

This paper introduces a novel, computationally efficient method for calibrating parameters in complex, large-scale multiagent models. By combining neural networks with differential equations, they can estimate parameter probability distributions orders of magnitude faster and more accurately than traditional methods, opening doors for more robust modeling in fields like epidemiology and economics.

What Problem Does This Paper Address?

Many scientific fields, particularly the social sciences, economics, and computational epidemiology, rely on complex computational models to understand dynamic systems. These models often have numerous parameters that cannot be determined from first principles and must be inferred from data. However, existing parameter estimation techniques are frequently mathematically intricate and computationally expensive, limiting their practical application, especially for large-scale models. This paper aims to bridge this gap by developing a method that is both computationally simple and fast, while still providing accurate parameter estimates.

Methods

The core of the proposed method is a pipeline that leverages neural networks and differential equations. Here's how it works:

  1. Neural Differential Equations as Forward Solvers: Instead of directly estimating parameters, the neural network is trained to predict the model parameters. These predicted parameters are then fed into a numerical solver (which can be a multiagent model or a system of ODEs/SDEs) to generate a simulated time series or steady-state data.
  2. Loss Function and Backpropagation: A loss function (typically mean squared error) is calculated by comparing the simulated data with the observed data. This loss is then backpropagated through the neural network to update its internal weights and biases, aiming to minimize the error.
  3. Parameter Density Estimation: Crucially, the method doesn't just output point estimates for parameters. By analyzing the loss landscape during training, the authors can estimate the probability density of the parameters, providing a measure of uncertainty.
  4. Autodifferentiation: The paper emphasizes the use of automatic differentiation libraries in machine learning frameworks, which simplifies the complex process of calculating gradients through the model and its solver.

The novelty lies in framing the parameter estimation problem as a neural network task where the network learns to output parameters that, when used in a forward model, reproduce observed data. This bypasses the need for explicit analytical solutions or complex iterative optimization schemes often required by classical methods.

Datasets

The authors demonstrate their method on two main types of data:

  1. Synthetic Data:
    • SIR Model: Time series data generated from a synthetic SIR (Susceptible-Infectious-Recovered) agent-based model simulating disease spread. This was used to test the method on time-series data and assess its ability to handle noise.
  2. Harris-Wilson Model: Synthetic steady-state data generated from the Harris-Wilson economic model. This was used to test the method on a nonconvex problem with known global minima and to analyze the impact of noise.
  3. Real-World Data:
    • London Economic Activity Data: A real dataset of economic activity in Greater London, comprising origin zone sizes (residential areas) and destination zone sizes (retail centers), along with convenience metrics (travel times/distances). This dataset was previously analyzed using MCMC methods.

Key Insights and Ideas

  • Neural Networks as Parameter Generators: The core insight is reframing parameter estimation not as a direct search, but as a generative task for a neural network. The network learns to produce parameters that make the forward model match data.
  • Speed and Accuracy Synergy: The neural network approach, combined with efficient solvers and autodifferentiation, leads to dramatic speedups (195-390x faster) while simultaneously improving calibration accuracy (2-3 orders of magnitude better MSPE).
  • Probabilistic Parameter Estimates: The method naturally yields probability densities for parameters, offering crucial uncertainty quantification, which is often challenging with purely deterministic optimization.
  • Handling Nonconvexity: By training the neural network multiple times with different initializations, the method can effectively explore the parameter space and identify multiple global minima, a significant advantage for nonconvex loss landscapes.
  • Robustness to Noise: The framework can be adapted to handle noisy data, and even learn the noise level itself, making it applicable to real-world scenarios where data is imperfect.

Key Results

  • SIR Model: The method successfully recovered parameters for the SIR model from synthetic time series data, demonstrating its ability to handle dynamic systems and noise.
  • Harris-Wilson Model (Synthetic Data): The method accurately identified parameters for the Harris-Wilson model, even in the presence of noise, and showed robustness to the nonconvex nature of the problem.
  • Harris-Wilson Model (London Data): When applied to real-world economic data from London, the neural network approach achieved significantly better predictive accuracy (2-3 orders of magnitude improvement in MSPE) and was dramatically faster (195-390x speedup) compared to a previous MCMC study. For instance, calibration took just over a minute with the neural method versus 3-7 hours with MCMC.

Limitations and Future Work

  • Solver Efficiency: The paper notes that the computational bottleneck can lie in writing a fast numerical solver compatible with autodifferentiation. Explicitly iterating over agents or network nodes should be avoided.
  • Model Complexity and Scale: The authors acknowledge that scaling to problems with a very large number of parameters (e.g., learning network structures directly) is a future research direction.
  • Dynamical Range Analysis: It's crucial to analyze the model's dynamical range beforehand to avoid nonidentifiable regimes where parameters cannot be learned.
  • Numerical Stability: Maintaining numerical stability during training is essential, especially in parameter regimes exhibiting chaotic behavior.
  • Future Work: The authors plan to investigate how the model performance scales with the number of parameters, particularly for large parameter sets like graph adjacency matrices. They also aim to explore more complex neural network architectures and solver integrations.

Summary updated

Abstract

Computational models have become a powerful tool in the quantitative sciences to understand the behavior of complex systems that evolve in time. However, they often contain a potentially large number of free parameters whose values cannot be obtained from theory but need to be inferred from data. This is especially the case for models in the social sciences, economics, or computational epidemiology. Yet, many current parameter estimation methods are mathematically involved and computationally slow to run. In this paper, we present a computationally simple and fast method to retrieve accurate probability densities for model parameters using neural differential equations. We present a pipeline comprising multiagent models acting as forward solvers for systems of ordinary or stochastic differential equations and a neural network to then extract parameters from the data generated by the model. The two combined create a powerful tool that can quickly estimate densities on model parameters, even for very large systems. We demonstrate the method on synthetic time series data of the SIR model of the spread of infection and perform an in-depth analysis of the Harris-Wilson model of economic activity on a network, representing a nonconvex problem. For the latter, we apply our method both to synthetic data and to data of economic activity across Greater London. We find that our method calibrates the model orders of magnitude more accurately than a previous study of the same dataset using classical techniques, while running between 195 and 390 times faster.
BibTeX
@inproceedings{gaskin2023neural,
  author = {Thomas Gaskin and Grigorios A. Pavliotis and Mark Girolami},
  title = {{Neural parameter calibration for large-scale multiagent models}},
  booktitle = {Proceedings of the National Academy of Sciences},
  year = {2023},
  doi = {10.1073/pnas.2216415120},
}
Figure