Source-linked AI summary
Agent-Based Transport Model Calibration via Online Stochastic Batch Optimization
Abdelkader Dib, Milos Balac
TL;DR
Calibrating ABMs is computationally demanding because traditional approaches can require hundreds or thousands of full simulation runs. This paper embeds stochastic batch optimization in a single MATSim run, where mode shares aligned with observed values in about 60 iterations, comparable to the uncalibrated iteration count.
Problem
ABM calibration seeks parameters that align simulated outputs with observations, but traditional black-box approaches can require hundreds or thousands of computationally costly full runs.
Source: §1 · pp. 1–2Method
The framework embeds online stochastic batch optimization in one simulation run, estimating candidate parameters from stored iteration outcomes and sampled mode choices.
Source: §1 · p. 2, §4.1 · p. 6Results
In approximately 60 iterations, online calibration aligned simulated mode shares with observed values, comparable to the iteration count without calibration.
Source: §6 · p. 12Takeaways & Limitations
The authors conclude that calibration can be achieved within one simulation run, opening the possibility of applying the method to other models and calibration problems.
Source: §7 · p. 14Different MATSim iterations may lead optimizers to different local minima, and momentum smoothing can trap parameters in potentially non-optimal mixtures of those minima.
Source: §6.2 · p. 13
Abstract
from arXiv · showhide
Calibrating agent-based models (ABMs) is computationally demanding, as traditional black-box optimization typically requires hundreds or thousands of independent simulation runs. To reduce this burden, we introduce an online calibration framework that estimates parameters within a single simulation run. The approach combines black-box optimization with stochastic batch optimization, a method widely applied in machine learning but not yet explored in ABM calibration. Using MATSim as a case study, we treat each simulation iteration as a stochastic batch, enabling incremental parameter updates as agents make decisions. This online calibration paradigm allows model parameters and agent behaviors to co-evolve, achieving convergence without restarting the simulation. We demonstrate the effectiveness of our method by calibrating utility function parameters in MATSim for a large-scale transportation scenario of Switzerland. Results show that mode shares align closely with observed data within a typical simulation timeframe, confirming the feasibility and efficiency of the approach. By embedding calibration directly into the simulation loop, our method opens new possibilities for real-time, scalable, and efficient calibration of complex ABMs.
1. Introduction
ABM calibration aligns simulated outputs with observations, but large-scale MATSim calibration can require hundreds or thousands of costly full runs. The paper proposes embedding stochastic batch optimization in a single simulation run.
1. Introduction
- MATSim mode-choice parameters often need adjustment to match observed mode shares because of model discrepancy, survey-data limitations, and unmeasured regional factors.The examples of unmeasured factors include comfort, public-transport crowding, and perceived safety.Source: §1 · p. 1
- Hundreds or thousands of full simulation runs can make calibration impractical for large-scale models with millions of agents and runs lasting hours.Traditional workflows compare each candidate parameter set with observed outputs before proposing another set.Source: §1 · pp. 1–2
- The paper proposes online calibration with stochastic batch optimization, updating parameters within a single simulation rather than through repeated independent runs.The approach adapts a machine-learning technique not previously applied to ABM calibration, to the authors’ knowledge.Source: §1 · p. 2
2. Related Work
Prior ABM calibration work includes black-box search, surrogate models, and MATSim-specific frameworks, but the paper distinguishes its approach by updating parameters during simulation execution.
2. Related Work
- ABMs require parameter calibration against observed data, and their stochastic, computationally intensive simulations make search increasingly challenging as model complexity grows.Trial-and-error, grid search, and random sampling become impractical as complexity increases.Source: §2 · p. 2
- Calibration research includes evolutionary and population-based methods, Bayesian optimization, and gradient-free SPSA.Examples include genetic algorithms, particle swarm optimization, and CMA-ES.Source: §2 · p. 2
- Surrogate approaches approximate ABM outputs to reduce repeated simulation costs, but high-dimensional neural-network surrogates can overfit and require careful selection and validation.Named surrogate families include Gaussian processes, support vector machines, random forests, and deep neural networks.Source: §2 · pp. 2–3
- MATSim calibration studies have used black-box optimizers, search acceleration, and surrogates; one ASC-specific method updates constants after each full run and converged in a few iterations.The cited frameworks include SPSA, CMA-ES, NES, and surrogate models.Source: §2 · p. 3
- Unlike these multi-run frameworks, the proposed approach continuously updates parameters during one simulation’s execution.The authors state that this strategy had not previously been applied in this context, to their knowledge.Source: §2 · p. 3
3. Background
The background describes the data-to-simulation pipeline and the choice and optimization mechanisms that underpin the paper’s online calibration approach.
3.1. eqasim
- eqasim generates synthetic populations and travel demand from public data, including agent attributes and daily activity plans.It draws on sources such as census records, travel surveys, and OpenStreetMap.Source: §3.1 · p. 3
3.2. MATSim
- MATSim simulates large transportation systems using networks and synthetic populations, iteratively replanning a subset of agents’ daily activities and travel choices toward equilibrium.Replanning can change departure times, routes, or transport modes, with updated plans evaluated in subsequent iterations.Source: §3.2 · p. 3
3.3. Discrete Mode Choice Modeling in MATSim
- MATSim’s discrete mode choice extension lets selected agents reconsider modes using travel times and other attributes as network conditions evolve.The extension supports informed replanning among alternatives such as car, walking, cycling, and public transport.Source: §3.3 · p. 4
- Mode utility combines observable deterministic utility with a Gumbel-distributed error, while deterministic utility uses an alternative-specific constant and weighted choice variables.The logit rule gives the probability of selecting an alternative, and choices can be realized through pseudo-random errors or multinomial sampling.Source: §3.3 · p. 4
3.4. Stochastic Gradient Methods
- Stochastic gradient methods update parameters using noisy mini-batch gradients, while momentum and adaptive learning-rate methods address gradient noise and optimization behavior.Momentum uses previous updates to smooth the trajectory; RMSprop and Adam adapt learning rates by parameter.Source: §3.4 · p. 5
4. Methodology
The framework calibrates MATSim parameters during its iterative simulation by recording replanning agents’ choice situations and optimizing against observed outcomes. It uses iteration-specific data and parameter updates, with methods tailored to the available observations and calibration target.
4. Methodology
- The framework is presented for calibrating discrete-mode utility parameters, with minor modifications allowing other simulation parameters such as link capacities and free-flow speeds.Source: §4 · p. 5
4.1. Proposed Calibration Framework
- Because choice variables are assumed to change negligibly between successive iterations, replanning agents’ choice situations are logged and reused to optimize parameters against observed outcomes.Source: §4.1 · pp. 5–6
4.2. Optimization
- The modular Python implementation supports derivative-free optimizers including CMA-ES, SPSA, PSO, TPE, and Genetic Algorithm.Source: §4.2 · p. 6
4.2.1. Problem formulation
- At each iteration, the objective minimizes a loss measuring discrepancy between observed data and simulated outcomes for agents who replanned.Source: §4.2.1 · p. 6
4.2.2. Optimization Process
- The optimizer proposes parameters, samples Gumbel errors in its initial optimization iteration, evaluates resulting choices, and repeats using feedback until convergence or the iteration limit.Because each iteration uses a random subset of agents, the iteration-specific optimum primarily guides the direction of later parameter updates rather than serving as a final optimum.Source: §4.2.2 · p. 7
4.2.3. Calibration objectives
- Calibration objectives include MSE, MAE, Jensen-Shannon divergence, and Kullback-Leibler divergence; individual survey choices can instead support iteration-level re-estimation with Biogeme.Source: §4.2.3 · p. 7
4.2.4. Special Case: Mode-Specific Constants Calibration
- For ASC-only calibration, a closed-form update aligns simulated and observed mode shares while fixing one reference-mode constant to ensure a unique solution.The simulated share used in the update is restricted to agents who replanned in that iteration.Source: §4.2.4 · p. 7
4.3. Parameters update
- An exponential moving average smooths proposed parameters with the previous iteration’s values, reducing oscillations and stabilizing learning.Source: §4.3 · p. 8
5. Experiments
The experiments apply online calibration to a large-scale Switzerland transport model through three parameter-calibration tests. They examine joint utility-parameter calibration, ASC-only calibration, and canton-specific constants.
5. Experiments
- The Switzerland model covers the entire national territory across all cantons, uses a 5% population sample, and represents five modes; car passengers remain passengers throughout and do not choose modes.The modes are walking, cycling, car as driver, car passenger, and public transport.Source: §5 · p. 8
5.1. Calibration of Mode-Specific Constants and Travel Time Marginal Utilities
- The first experiment calibrates seven mode-specific constants and travel-time marginal utilities, leaving the remaining utility parameters at their defaults.It minimizes log-MSE discrepancies in global mode shares and shares by Euclidean trip distance using Swiss Microcensus observations.Source: §5.1 · p. 9
- CMA-ES uses a population of 40 and warm-starts later iterations from previously evaluated solutions; its decay rate rises toward 1 every 30 iterations.The authors selected CMA-ES after comparing optimizers; alternatives either failed to converge or were less computationally efficient for this formulation.Source: §5.1 · p. 9
- Parameters converge rapidly and stabilize, while simulated and observed mode shares agree well, with residual distribution discrepancies attributed to partial calibration.The comparison covers global shares and shares by Euclidean trip distance; parameters are averaged over the last few iterations.Source: Figure 4 · p. 9, Figure 5 · p. 9, Figure 3 · p. 9
5.2. Mode Specific Constants Calibration
- The ASC-only test fixes αpt at zero, tests initial γ values of 0.3, 0.5, and 0.7, and smooths per-iteration updates.Equation 8 computes ASC values after each iteration, and Equation 9 smooths their variations.Source: §5.2 · p. 10
- All three ASC-only experiments match mode shares within 60 iterations and converge to the same stable parameters; the lowest γ converges fastest.Parameters remain stable after iteration 60 as γ rises and reduces fluctuations.Source: §5.2 · p. 10, Figure 7 · p. 10
5.3. Canton-Specific Mode Specific Constant Calibration
- Canton-specific calibration assigns constants by agent residence and updates them only when a canton’s replanning batch reaches 800 agents.Updates use each canton’s residents; the method assumes canton independence, although inter-cantonal mobility creates spatial dependencies.Source: §5.3 · p. 11
- Canton-specific constants reproduce similar mode shares within cantons, although car-passenger discrepancies are largest; Appenzell Innerrhoden may be overfitted and cannot be validated further without actual mode-share data.Car-passenger discrepancies are partly explained by fixed initial choices and the 5% population sample.Source: §5.3 · p. 12, Figure 9 · p. 12
6. Discussion
The online approach aligns simulated and observed mode shares in one run, with calibration converging in about 60 iterations. The discussion considers computational cost, methodological challenges, implementation recommendations, and possible extensions.
6. Discussion
- Calibration aligned simulated mode shares with observed values in one run and converged in approximately 60 iterations, comparable to the iterations required without calibration.When calibrating only mode-specific constants, runtime overhead is negligible; broader black-box optimization took 2–3 minutes per MATSim iteration in these experiments.Source: §6 · p. 12, §6.1 · p. 12
6.1. Computational Performance
- Mode-specific-constant calibration has negligible runtime overhead, while broader black-box optimization took 2–3 minutes per MATSim iteration and depends on optimizer settings and parameter count.Early convergence criteria can be relaxed because evolving network conditions make update direction more important than precise early optima.Source: §6.1 · p. 12
6.2. Methodological Limitations and Challenges
- Prior optimization-based calibration often lacks repeated trials for parameter-stability assessment; correlated objectives and parameters can create compensatory effects and non-convex landscapes with local minima.Across online iterations, optimizers may find different solutions, and momentum smoothing can leave parameters in mixtures that may not be optimal. Behavioral realism is not guaranteed; analysts may need parameter bounds, and behavioral validity is outside this paper's scope.Source: §6.2 · p. 13
6.3. Recommendations for Implementation
- The authors recommend formulating convex objectives, increasing optimizer settings such as CMA-ES population size when needed, or using progressive optimization with a full initial run and later warm starts.One proposed implementation reuses current and prior-iteration data, a consistent random seed, and optimization history.Source: §6.3 · p. 13
- For highly stochastic models, calibration can run every n iterations using the latest n iterations jointly; the presented method is the special case n = 1.When agents replanned multiple times, only their most recent replanning decision is retained.Source: §6.3 · p. 13
6.4. Perspectives / Future Directions
- Equation 8 was applied to calibrate mode shares both globally across MATSim iterations and separately within each canton.Source: §6.4 · p. 13
- Future work could test marginal-utility calibration by parameter bins and explore transfer to other ABMs, standard MATSim without DMC, and network parameters.Source: §6.4 · p. 13
7. Conclusion
The paper presents online stochastic-batch calibration for ABMs and demonstrates it on MATSim utility parameters. Calibration was achieved in one simulation run, and the authors identify possible extensions and further methodological work.
7. Conclusion
- The method combines stochastic batch optimization with black-box optimization to calibrate MATSim utility-function parameters in a single simulation run, demonstrated in three experiments.Source: §7 · p. 14
- Calibration was achieved within one simulation run, opening the possibility of applying the method to other models and calibration problems.Source: §7 · p. 14
- Future work includes suitable objective functions, alternative optimizers, improved momentum mechanisms, other ABMs and parameter sets, and simulation-environment parameters such as network capacities and speeds.Source: §7 · p. 14