bioRxiv · 10.1101/2025.08.05.668369
denim: an R package for deterministic compartmental models with flexible dwell time distributions
Abstract
O_LICompartmental models are widely used for dynamical systems where states are discrete such as in infectious diseases epidemiology with the so-called SIR or Susceptible-Infectious-Recovered framework. For mathematical simplicity, rates of transition between compartments are generally assumed to be independent of the dwell time (or secondary time scale in survival analysis): they are either constant or dependent on the epidemiological time (or primary time scale in survival analysis) only, either directly (e.g. environmental or behavioral forcings in epidemiological models) or indirectly through dependence on other variables of the system (e.g. the force of infection in epidemiological models). In some domains of application, this memoryless assumption leads to distributions of dwelling times that are incompatible with those observed on data which can lead to serious problems since the model predictions are highly sensitive on the exact shape of these distributions. C_LIO_LIHere we propose a deterministic, continuous-variable, numerical modelling approach that allows full flexibility on the dwell time distributions. The accompanying denim package provides a user-friendly interface to implement our proposed method through a dedicated language for model definition. C_LIO_LIThe package is open-source and available on CRAN. With more detailed data on the clinical process of infections becoming available, the denim package will be extremely useful for building more realistic epidemiological models providing more accurate projections. C_LI The denim package is publicly available for download on CRAN (https://cran.r-project.org/web/packages/denim/index.html) and GitHub (https://github.com/thinhong/denim). Additional documentation can be found on the denim webpage (https://drthinhong.com/denim/). Bug reports can be submitted via Github Issue.
Source connections
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Ong, T. P., Phan, A. T. Q., Ha, L. M., Choisy, M.. 2025-08-06. denim: an R package for deterministic compartmental models with flexible dwell time distributions. https://doi.org/10.1101/2025.08.05.668369
Cite the original work for its findings. Save a collection to share your selection of sources.