English

gemlib: Probabilistic programming for epidemic models

Computation 2025-11-12 v1 Applications

Abstract

gemlib is a Python library for defining, simulating, and calibrating Markov state-transition models. Stochastic models are often computationally intensive, making them impractical to use in pandemic response efforts despite their favourable interpretations compared to their deterministic counterparts. gemlib decomposes state-transition models into three key ingredients which succinctly encapsulate the model and are sufficient for executing the subsequent computational routines. Simulation is performed using implementations of Gillespie's algorithm for continuous-time models and a generic Tau-leaping algorithm for discrete time models. gemlib models integrate seamlessly with Markov Chain Monte Carlo samplers as they provide a target distribution for the inference algorithm. Algorithms are implemented using the machine learning computational frameworks JAX and TensorFlow Probability, thus taking advantage of modern hardware to accelerate computation. This abstracts away computational concerns from modellers, allowing them to focus on developing and testing different model structures or assumptions. The gemlib library enables users to rapidly implement and calibrate stochastic epidemic models with the flexibility and robustness required to support decision during an emerging outbreak.

Keywords

Cite

@article{arxiv.2511.08124,
  title  = {gemlib: Probabilistic programming for epidemic models},
  author = {Alin Morariu and Jess Bridgen and Chris Jewell},
  journal= {arXiv preprint arXiv:2511.08124},
  year   = {2025}
}
R2 v1 2026-07-01T07:31:52.624Z