Automatic calibration and post-processing adjustment for ABMs
The University of Utah
Agent-Based Models [ABMs] are an important tool for scientific research and policy-making:
Calibration can be time-consuming: grid search, Markov models, etc.
There’s no consensus on the best calibration approach.
ABMs (and models in general) are limited in their predictive power.
Schematic of compartmental and ABMs used by the US Centers for Disease and Control Prevention during a Measles Outbreak Response CDC (2024).
Specify the model to be calibrated, for example, a SIR model. We will denote the model \(\mathcal{M}: \boldsymbol{\theta} \to \mathbf{Y}\).
Identify the model parameters \(\boldsymbol{\theta}\) that will be calibrated. In the case of a SIR model, we may want to specify the contact, infection, and recovery rates.
Simulate the model \(N\) times drawing \(\boldsymbol{\theta}\) from a prior distribution. The simulation procedure follows: For \(i \in \{1,\dots,N\}\) do
We will have our training dataset \(T\equiv\left\{\boldsymbol{\theta}_i, y_i\right\}_{i=1}^N\).
Finally, we can use the training set to generate the mapping \(\mathcal{C}: \boldsymbol{Y} \to \boldsymbol{\theta}\).
With the calibrated model \(\mathcal{C}\), we can answer the question “What parameters \(\theta\) better fit the observed data?”.
Mechanistic Machine Learning [MechML]–a.k.a. theory-guided data science/machine learning: A hybrid between theory and data-driven prediction.
Mechanistic models
Machine Learning
ML can help explain what theory hasn’t… but we still need theory (Lazer et al. 2014)!
Adjusting errors in mechanistic-based prediction models (like ABMs). (Compagni et al. 2022)
Incorporating mechanistically inferred data as an additional -omics layer. (Zampieri et al. 2019)
Using pathway networks to add “external knowledge” as features. (Al taweraqi and King 2022)
Creating a loss function with a mechanistic penalty for modeling tumor cell density (Gaw et al. 2019)
Using simulations to inform neural networks for epidemic forecasting (Wang, Chen, and Marathe 2020).
and more (Jorner et al. 2021; Willard et al. 2022; Jia et al. 2021; von Rueden et al. 2023)
Warning
Mechanistic Machine Learning is not domain-knowledge-aided feature engineering. You need a whole other model to complement the ML algorithm.
This isn’t just an ML ensemble; you must have an ML and a Mech model.
Train a model that predicts ABM forecast errors. The model takes the following form:
\[ Loss(\boldsymbol{\omega}): \left\{\mathcal{M}(\boldsymbol{\theta}), \boldsymbol{x}\right\} \to \widehat{\boldsymbol{\varepsilon}} \equiv \left\lVert \widehat{\boldsymbol{\varepsilon}} - f\left(\boldsymbol{\omega}, \mathcal{M}(\boldsymbol{\theta}), \boldsymbol{x}\right)\right\rVert{}_p, \]
where \(\widehat{\boldsymbol{\varepsilon}}\equiv \left(\mathcal{M}(\boldsymbol{\theta}) - y_{obs}\right)\) ABM forecast error, \(\boldsymbol{y}_{obs}\) is the observed data, \(f(\cdot)\) is a non-linear function, \(\boldsymbol{x}\) are additional features for the model, and \(\boldsymbol{\omega}\) is an array of weights associated with the ML o predict \(\boldsymbol{\varepsilon}\).
Use the ABM predictions as a feature in the ML model. The model takes the following form:
\[ Loss(\boldsymbol{\omega}) \equiv \left\lVert \boldsymbol{y}_{obs} - f\left(\boldsymbol{\omega}, \mathcal{M}(\boldsymbol{\theta}), \boldsymbol{x}\right)\right\rVert{}_p, \]
Use a mechanistic penalty in the ML loss function. The model takes the following form:
\[ Loss(\boldsymbol{\omega}) \equiv \left\lVert \boldsymbol{y}_{obs} - f\left(\boldsymbol{\omega}, \boldsymbol{x}\right)\right\rVert{}_p + \lambda \left\lVert f\left(\boldsymbol{\omega}, \boldsymbol{x}\right) - \mathcal{M}(\theta)\right\rVert{}_p, \]
where \(\lambda\) is a hyperparameter that controls the weight of the mechanistic penalty.
Susceptible-Infected Recovered model:
epiworldR
.We trained a convolutional neural network to build our calibrator:
\[ \mathcal{C}: \text{Epicurves} \to \boldsymbol{\theta} \]
Where \(\boldsymbol{\theta} = \left[\text{Init. state}\text{Contact Rate}, \text{P(transmit)}, \text{P(recover)}\right]\)
Parameter | Predicted | Truth |
---|---|---|
Init. state | 0.01 | 0.01 |
Contact Rate | 6.29 | 8.00 |
P(transmit) | 0.33 | 0.30 |
P(recover) | 0.33 | 0.30 |
Example model by speaker using mechanistic machine learning to improve accuracy in prediction of gene functions.
ABMs are a powerful tool for research and policy analysis.
Overall, calibration and prediction are challenging tasks; the latter, even for advanced ML models.
We propose a method that leverages the best of both worlds: mechanistic models and machine learning: Machine Learning Sandwich for ABM Models.
The calibration step leverages artifical data for training.
The forecasting step is addressed using Mechanistic Machine Learning [MechML]. At least three ways to apply it:
ML to correct for systematic biases.
Mech predictions as features in an ML algorithm.
A Mech penalty embedded in the ML Loss function.
Finally, we presented preliminary results on calibration of an SIR model and predictions using MechML for gene function prediction.
George G. Vega Yon, Ph.D.
The University of Utah
https://ggvy.cl
George G. Vega Yon, Ph.D. – ggv.cl/slides/exeter-abm-2024