rjsf: R Implementation of the Jump-Switch-Flow Stochastic Simulation Algorithm
Stochastic simulation is essential in computational biology and infectious disease modelling, but existing methods require a trade-off between accuracy and computational efficiency. While exact stochastic simulation captures dynamics in small populations, it scales poorly, whereas deterministic ODE models are efficient but fail to capture stochastic effects. The Jump-Switch-Flow (JSF) framework addresses this by dynamically switching between stochastic simulation and deterministic ODE integration based on population size. However, despite a mature Python implementation, R remains the dominant language in epidemiology and biostatistics, creating a significant accessibility gap. This project will develop rjsf, an R package that provides user-friendly functions for running the Python `jsf` library directly within R workflows via reticulate. Key deliverables include a core simulation function, S7-based result objects, diagnostic and visualisation tools, a comprehensive test suite, and a detailed vignette, with the goal of CRAN submission. As a stretch goal, the project will explore incorporating additional intermediate stochastic simulation methods to further enhance flexibility and performance. The resulting package will enable researchers and scientists to seamlessly integrate hybrid stochastic-deterministic simulation into their existing R-based modelling workflows.
Project details
Technologies
Not listed in the archive