denim: An R package for deterministic compartmental models with flexible dwell‐time distributions

Abstract Compartmental models are widely used for dynamical systems where states are discrete, such as in infectious disease epidemiology with the so‐called Susceptible‐Infectious‐Recovered (SIR) framework. For mathematical simplicity, rates of transition between compartments are generally assumed to be independent of the dwell time (or secondary timescale in survival analysis): they are either constant or dependent on the epidemiological time (or primary timescale in survival analysis) only, either directly (e.g. environmental or behavioural 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 in data (e.g. infectious periods for childhood diseases), which can lead to serious problems since the model predictions are highly sensitive to the exact shape of these distributions. Here, 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. The package is open source and available on CRAN. As more detailed data on the clinical process of infections become available, the denim package will be extremely useful for building more realistic epidemiological models that provide more accurate projections.

Authors

Institutions

Publication Details

Journal
Methods in Ecology and Evolution
Published
2026-02-12
DOI
https://doi.org/10.1111/2041-210x.70256
Primary Topic
COVID-19 epidemiological studies
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

denim: An R package for deterministic compartmental models with flexible dwell‐time distributions

Phuc Thinh Ong, Marc Choisy, Anh Truong Quynh Phan, Lam Minh Ha
Methods in Ecology and Evolution
COVID-19 epidemiological studies
article

denim: An R package for deterministic compartmental models with flexible dwell‐time distributions

Phuc Thinh Ong, Marc Choisy, Anh Truong Quynh Phan, Lam Minh Ha
article en

Abstract

Abstract Compartmental models are widely used for dynamical systems where states are discrete, such as in infectious disease epidemiology with the so‐called Susceptible‐Infectious‐Recovered (SIR) framework. For mathematical simplicity, rates of transition between compartments are generally assumed to be independent of the dwell time (or secondary timescale in survival analysis): they are either constant or dependent on the epidemiological time (or primary timescale in survival analysis) only, either directly (e.g. environmental or behavioural 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 in data (e.g. infectious periods for childhood diseases), which can lead to serious problems since the model predictions are highly sensitive to the exact shape of these distributions. Here, 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. The package is open source and available on CRAN. As more detailed data on the clinical process of infections become available, the denim package will be extremely useful for building more realistic epidemiological models that provide more accurate projections.

Methods in Ecology and Evolution
University of Oxford (GB), Oxford University Clinical Research Unit (VN)
Wellcome Trust
Good health and well-being
Openalex Percentile: Top 61%
COVID-19 epidemiological studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

denim: An R package for deterministic compartmental models with flexible dwell‐time distributions — Phuc Thinh Ong, Marc Choisy, et al. · Methods in Ecology and Evolution (2026) | TGRS Research Map | TGRS