Real-time agent-based crowd simulation with the Reversible Jump Unscented Kalman Filter

https://doi.org/10.1016/j.simpat.2021.102386Get rights and content

Abstract

Commonly-used data assimilation methods are being adapted for use with agent-based models with the aim of allowing optimisation in response to new data in real-time. However, existing methods face difficulties working with categorical parameters, which are common in agent-based models. This paper presents a new method, the RJUKF, that combines the Unscented Kalman Filter (UKF) data assimilation algorithm with elements of the Reversible Jump (RJ) Markov chain Monte Carlo method. The proposed method is able to conduct data assimilation on both continuous and categorical parameters simultaneously. Compared to similar techniques for mixed state estimation, the RJUKF has the advantage of being efficient enough for online (i.e. real-time) application. The new method is demonstrated on the simulation of a crowd of people traversing a train station and is able to estimate both their current position (a continuous, Gaussian variable) and their chosen destination (a categorical parameter). This method makes a valuable contribution towards the use of agent-based models as tools for the management of crowds in busy places such as public transport hubs, shopping centres, or high streets.

Introduction

Agent based models (ABMs) have become a popular method for simulating the dynamics of crowds [1], [2] due to their ability to readily simulate individuals and their behaviour. In general, such models are calibrated to historical data and then used to make predictions. However, ABMs rarely incorporate any real-time data [3], so cannot reflect changes within the target system that occur in real time. This prohibits their use as real-time management tools, limiting them to conducting offline experiments based on historical data. If ABMs were able to update their current state based on up-to-date information from the real-world, as is common in fields such as meteorology [4], then they could become valuable tools for the management of crowds in busy places such as public transport hubs, shopping centres, or high streets.

To address this limitation, data assimilation techniques have been proposed as a way to incorporate new data into predictive ABMs. The Unscented Kalman Filter (UKF), in particular, is a method that could operate effectively without requiring a large number of model replicas to be run simultaneously (an ‘ensemble’) which is important as ABMs are typically extremely computationally expensive [5]. However, the vanilla implementation of the UKF has a number of limitations. In particular, the UKF is designed only for assimilating states with a Gaussian distribution – such as an agent’s location in real space – not categorical or discrete variables. Most ABMs have mixed states of both categorical and continuous variables with comparable importance [6], [7]. In models of crowds, for example, agents may have categorical variables to represent their gender [8], beliefs [9], destination [10], etc. These variables can define a totally different set of behaviours for each class of agent, so should not be disregarded as part of a data assimilation framework.

There is very limited research that deals data assimilation for ABMs, and even less that attempts to tackle the problem of combining continuous and categorical variables. This partly stems from the fact that advances in data assimilation have traditionally emerged from fields such as meteorology and hydrology, where models rarely incorporate categorical variables [4]. In short, there are two main problems that limit the veracity of current techniques. First, the model selection method, which is commonly used to deal with categorical variables, will struggle with the ‘curse of dimensionality’ that comes with categorical variables. For example, given an ABM with 10 agents each having a single categorical variable with 5 possible values, there are 510 (nearly 10 million) different combinations of categories. Second, typical data assimilation frameworks require each individual model realisation to have the same parameter dimensions. Because each agent has its own local parameter values, adding or removing agents from a model has the effect of changing the number of model parameters. This complicates the implementation of data assimilation with ABMs, as it is common for the number of agents to vary between model runs.

This paper extends the state-of-the-art by proposing a method that allows an Unscented Kalman Filter (UKF) to conduct data assimilation on an agent-based model that consists of a mixed state of categorical and Gaussian variables. The method, which we call Reversible Jump UKF (RJUKF) is inspired by Reversible Jump Markov Chain Monte Carlo (RJMCMC) [11]. Compared to similar techniques for mixed state estimation, the RJUKF has the advantage of being efficient enough for online (i.e. real-time) application. This method is also able to handle variable dimension models making it suitable for application to ABMs.

The approach is demonstrated in the context of estimating the behaviour of a crowd of people as they traverse a train station – specifically Grand Central Terminal in New York City – using an agent-based model, StationSim. The model of the crowd will inevitably diverge from the ‘true’ behaviour of the crowd for two reasons: (i) the trajectories of the pedestrians vary stochastically as they interact with each other; and (ii) although we assume an individual’s time and location of entry into the station are known (people are often recorded as they pass through barriers to enter a station), we cannot assume their destination is known, so this must be inferred from their evolving trajectories. The incorporation of up-to-date observations from the real world using an Unscented Kalman Filter can help to estimate the true locations of the pedestrians, but it cannot estimate the true destinations because these are categorical rather than continuous variables. For this, the RJUKF is needed. Experiments are presented to show that the RJUKF is able to estimate both location and destination, creating a much more robust real-time simulation of the station.

This paper is structured as follows: Section 2 reviews the relevant literature; Section 3 outlines the methods used, including a description of the agent-based model and the RJUKF; Section 4 outlines the experiments and results; and Section 5 draws conclusions and outlines potential future work.

Section snippets

Related work

The aim of Data Assimilation (DA) is to use current, real-world observations to update the internal state of a model. In this manner, “all the available information” [12] is used to create a combined representation of a system that is closer to its true state than either the observations or the model in isolation. Recent efforts have been made to develop methods that will allow ABMs to react to real-world events as they happen. Whilst promising, they exhibit a number of limitations such as: the

Reversible Jump Unscented Kalman Filter (RJUKF)

The main innovation offered by this paper is the introduction of the Reversible Jump Unscented Kalman Filter (RJUKF). We propose a combination of Reversible Jump Markov Chain Monte Carlo (RJMCMC) [11] with the Unscented Kalman Filter (UKF) as a means of conducting data assimilation utilising an efficient algorithm, the UKF, to estimate both categorical and Gaussian agent attributes in real time.

For example, in the StationSim agent-based model that simulates agents crossing a train station

Experiments

Two experiments are conducted to illustrate the efficacy of the proposed method. The first establishes the feasibility of applying the UKF to an ABM. The final experiment demonstrates the application of the UKF with categorical variables; i.e. using the RJUKF method. In the first experiment we assume that the agents’ destinations are known, so the filter only needs to correct for the noise introduced as agents collide and deviate from their otherwise straight paths. In the second experiment we

Conclusions

This paper has demonstrated how the combination of an Unscented Kalman Filter (UKF) and elements of the Reversible Jump MCMC algorithm can be combined to create an efficient algorithm that can scan a set of filters (parameterised by categorical variables) and filter over continuous variables simultaneously. This offers an advantage over previous attempts to conduct data assimilation on agent-based models that have largely used particle filters [10], [14], [15], [20] as the UKF can perform well

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References (56)

  • KalnayE.

    Atmospheric Modeling, Data Assimilation and Predictability

    (2003)
  • WanE.A. et al.

    The unscented Kalman filter for nonlinear estimation

  • RockettR.J. et al.

    Revealing COVID-19 transmission in Australia by SARS-CoV-2 genome sequencing and agent-based modeling

    Nature Med.

    (2020)
  • SwarupS. et al.

    26. Simulation analytics for social and behavioral modeling

    Social-Behav. Model. Complex Syst.

    (2019)
  • van der WalC.N. et al.

    Simulating crowd evacuation with socio-cultural, cognitive, and emotional elements

  • ZhouB. et al.

    Understanding collective crowd behaviors: Learning a mixture model of dynamic pedestrian-agents

  • MallesonN. et al.

    Simulating crowds in real time with agent-based modelling and a particle filter

    J. Artif. Soc. Soc. Simul.

    (2020)
  • GreenP.J.

    Reversible jump Markov chain Monte Carlo computation and Bayesian model determination

    Biometrika

    (1995)
  • TalagrandO.

    The use of adjoint equations in numerical modelling of the atmospheric circulation

  • KieuL.-M. et al.

    Dealing with uncertainty in agent-based models for short-term predictions

    R. Soc. Open Sci.

    (2020)
  • LloydD.J.B. et al.

    Exploring data assimilation and forecasting issues for an urban crime model

    European J. Appl. Math.

    (2016)
  • OlooF. et al.

    Predicting migratory corridors of white storks, ciconia ciconia, to enhance sustainable wind energy planning: a data-driven agent-based model

    Sustainability

    (2018)
  • EvensenG.

    The ensemble Kalman filter: Theoretical formulation and practical implementation

    Ocean Dyn.

    (2003)
  • LueckJ. et al.

    Who goes there? using an agent-based simulation for tracking population movement

  • TernesP. et al.

    Using data assimilation to reduce uncertainty in an agent-based pedestrian simulations in real time

    Philos. Trans. A

    (2020)
  • KalmanR.E.

    A new approach to linear filtering and prediction problems

    J. Basic Eng.

    (1960)
  • UhlmannJ.K.

    Dynamic Map Building and Localization: New Theoretical Foundations

    (1995)
  • ClayR. et al.

    Towards real-time crowd simulation under uncertainty using an agent-based model and an unscented Kalman filter

  • This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 757455), through a UK Economic and Social Research Council (ESRC) Future Research Leaders grant (ES/L009900/1), and through an internship funded by the UK Leeds Institute for Data Analytics (LIDA) . Computation was undertaken on ARC4, part of the High Performance Computing facilities at the University of Leeds, UK.

    View full text