Package: epidist 0.5.0

Sam Abbott

epidist: Estimate Epidemiological Delay Distributions with 'brms'

Understanding and accurately estimating epidemiological delay distributions is important for public health policy. These estimates influence epidemic situational awareness, control strategies, and resource allocation. This package provides methods to address the key challenges in estimating these distributions, including truncation, interval censoring, and dynamical biases. These issues are frequently overlooked, resulting in biased conclusions. Built on top of 'brms', it allows for flexible modelling including time-varying spatial components and partially pooled estimates of demographic characteristics.

Authors:Adam Howes [aut], Sang Woo Park [aut], Sam Abbott [aut, cre, cph], Sebastian Funk [ctb]

epidist_0.5.0.tar.gz
epidist_0.5.0.zip(r-4.7-any)epidist_0.5.0.zip(r-4.6-any)epidist_0.5.0.zip(r-4.5-any)
epidist_0.5.0.tgz(r-4.6-any)epidist_0.5.0.tgz(r-4.5-any)
epidist_0.5.0.tar.gz(r-4.7-any)epidist_0.5.0.tar.gz(r-4.6-any)
epidist_0.5.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
epidist/json (API)

# Install 'epidist' in R:
install.packages('epidist', repos = c('https://epinowcast.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/epinowcast/epidist/issues

Pkgdown/docs site:https://epidist.epinowcast.org

Datasets:

On CRAN:

Conda:

7.74 score 16 stars 1 packages 28 scripts 64 exports 80 dependencies

Last updated from:51d8d33ad5 (on v0.5.0). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK348
source / vignettesOK312
linux-releaseOK347
macos-releaseOK227
macos-oldrelOK321
windows-develOK306
windows-releaseOK299
windows-oldrelOK299
wasm-releaseOK193

Exports:add_delay_parameter_drawsadd_summariesas_epidist_aggregate_dataas_epidist_estimates_dataas_epidist_latent_modelas_epidist_linelist_dataas_epidist_marginal_modelas_epidist_meta_modelas_epidist_multivariateas_epidist_naive_modelassert_epidistbfdelay_parameter_drawsdelay_summary_drawsepidistepidist_diagnosticsepidist_estimates_epireviewepidist_estimates_parametersepidist_estimates_summariesepidist_familyepidist_family_modelepidist_family_priorepidist_formulaepidist_formula_modelepidist_gen_log_likepidist_gen_meta_log_likepidist_gen_meta_predictepidist_gen_posterior_epredepidist_gen_posterior_predictepidist_meta_leave_one_outepidist_model_priorepidist_newdataepidist_priorepidist_stancodeepidist_strataepidist_transform_data_modelGammais_epidist_aggregate_datais_epidist_datais_epidist_estimates_datais_epidist_latent_modelis_epidist_linelist_datais_epidist_marginal_modelis_epidist_meta_modelis_epidist_multivariateis_epidist_naive_modellognormalnew_epidist_aggregate_datanew_epidist_estimates_datanew_epidist_latent_modelnew_epidist_linelist_datanew_epidist_marginal_modelnew_epidist_meta_modelnew_epidist_multivariatenew_epidist_naive_modelplot_delaysplot_eventssimulate_datessimulate_exponential_casessimulate_gillespiesimulate_secondarysimulate_studysimulate_uniform_casesweibull

Dependencies:abindbackportsbayesplotBHbridgesamplingbrmsBrobdingnagcallrcheckmateclicodacodetoolscpp11descdigestdistributionaldplyrfarverfuturefuture.applygenericsggdistggplot2ggridgesglobalsgluegridExtragtableinlineisobandlabelinglatticelifecyclelistenvloolubridatemagrittrMatrixmatrixStatsmgcvmvtnormnleqslvnlmenumDerivotelparallellypillarpkgbuildpkgconfigplyrposteriorprimarycensoredprocessxpspurrrquadprogQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelreshape2rlangrstanrstantoolsS7scalesStanHeadersstringistringrtensorAtibbletidyrtidyselecttimechangeutf8vctrsviridisLitewithr

Frequently asked questions and tips
Working with posterior samples | Getting a data.frame of posterior samples | Using random variables (rvars) for uncertainty propagation | How can I assess whether sampling has converged? | How can I perform posterior predictive checks? | What is an observation in the meta model? | I'd like to run a simulation study | How are the default priors for epidist chosen? | How can I assess how sensitive the fitted posterior distribution is to the prior distribution used? | What do the parameters in my model output correspond to? | How can I generate predictions with my fitted epidist model? | How can I use the marginaleffects package with my fitted epidist model? | How can I use the cmdstanr backend? | References

Last update: 2026-09-25
Started: 2024-07-22

Using epidist to estimate delay between symptom onset and positive test for an Ebola outbreak in Sierra Leone
Using the cmdstanr backend | Data preparation | Fitting sex-district stratified delay distributions | Model fitting | Intercept-only model | Sex-stratified model | Sex-district stratified model | Posterior expectations | Linear predictor posteriors | Delay posterior distributions | Discrete probability mass function | Continuous probability density function | Conclusion | References

Last update: 2026-09-25
Started: 2024-09-09

Guide to the statistical models implemented in epidist
Background | Forwards and backwards distributions | Right truncation | Interval censoring | The naive model | The latent model | Bounding the latent primary event time | A non-uniform primary event | The marginal model | The meta model | Sampling likelihoods | A reported mean | A reported standard deviation | A reported quantile | Summaries from the same study | A vector of summaries with a covariance | Reported distribution parameters | Individual level records | What we need from each study | The biased estimands | Censoring adjustment | An estimated growth rate | Left truncation | Quantiles of the estimands | References

Last update: 2026-09-25
Started: 2025-02-18

Approximate Bayesian inference in epidist
Background | Alternative approximate inference algorithms | Laplace method | Variational inference using ADVI | Pathfinder | Demonstration | Comparison of parameter posterior distributions | Comparison of resulting delay distributions | Comparison of time taken | Conclusion | References

Last update: 2026-09-22
Started: 2024-07-15

Fitting to published estimates with the meta model
What we need from a study | Setup | Simulating biased published estimates | Fitting and comparing models | A bias-adjusted fit to the summaries alone | Allowing studies to differ | What happens with the wrong metadata | A mixed fit: summaries plus individual records | Reference: the marginal model on the full line list | Comparing the fits | Real world estimates from epireview | Adjusting for the phase of the outbreak | The population level delay and the size of the phase bias | Comparing with a modern re-analysis of the same line list | Learning more | References

Last update: 2026-09-22
Started: 2026-09-04

Getting started with epidist
Key concepts in delay distribution estimation | Setup | Simulating data | Preprocessing the data | The observation process | Fitting models | Fit a model that doesn't account for censoring and truncation | Fit a model that accounts for biases and truncation | Compare the two models estimated delay parameters | Visualise posterior predictions of the true delay distribution | Learning more | References

Last update: 2026-09-22
Started: 2023-12-08

Primary event distributions
Background | Simulating from a growing epidemic | Uniform against exponential growth | A growth rate that varies | Identifying the growth rate | Summary | References

Last update: 2026-09-22
Started: 2026-09-02

Left truncation with delay_min
Setup | Simulate left truncated data | Fit models with and without the adjustment | Compare parameter estimates | Compare the estimated delay distributions | Summary

Last update: 2026-09-12
Started: 2026-08-26

Extending epidist
Why extend epidist? | Adding a data source | Adding a model type | Exploring how cfrnow extends epidist | Getting help

Last update: 2026-08-26
Started: 2026-08-26

Readme and manuals

Help Manual

Help pageTopics
Add natural scale summaries of the delay distributionadd_summaries
Export a fitted delay distribution as a 'distspec' distributionas_dist_spec.epidist_fit
Create an epidist_aggregate_data objectas_epidist_aggregate_data
Create an epidist_aggregate_data object from a data.frameas_epidist_aggregate_data.data.frame
Create an epidist_aggregate_data object from vectors of event timesas_epidist_aggregate_data.default
Convert linelist data to aggregate formatas_epidist_aggregate_data.epidist_linelist_data
Create an 'epidist_estimates_data' objectas_epidist_estimates_data
Create an 'epidist_estimates_data' object from a data frameas_epidist_estimates_data.data.frame
Return an 'epidist_estimates_data' object unchangedas_epidist_estimates_data.epidist_estimates_data
Create an 'epidist_estimates_data' object from a multivariate representationas_epidist_estimates_data.epidist_multivariate
Combine 'epidist_estimates_data' objects from several studiesas_epidist_estimates_data.list
Convert an object to an 'epidist_latent_model' objectas_epidist_latent_model
The latent model method for 'epidist_aggregate_data' objectsas_epidist_latent_model.epidist_aggregate_data
The latent model method for 'epidist_linelist_data' objectsas_epidist_latent_model.epidist_linelist_data
Create an epidist_linelist_data objectas_epidist_linelist_data
Create an epidist_linelist_data object from a data frame with event datesas_epidist_linelist_data.data.frame
Create an epidist_linelist_data object from vectors of event timesas_epidist_linelist_data.default
Convert aggregate data to linelist formatas_epidist_linelist_data.epidist_aggregate_data
Convert an object to an 'epidist_marginal_model' objectas_epidist_marginal_model
The marginal model method for 'epidist_aggregate_data' objectsas_epidist_marginal_model.epidist_aggregate_data
The marginal model method for 'epidist_linelist_data' objectsas_epidist_marginal_model.epidist_linelist_data
Convert an object to an 'epidist_meta_model' objectas_epidist_meta_model
The meta model method for 'epidist_aggregate_data' objectsas_epidist_meta_model.epidist_aggregate_data
The meta model method for 'epidist_estimates_data' objectsas_epidist_meta_model.epidist_estimates_data
The meta model method for 'epidist_linelist_data' objectsas_epidist_meta_model.epidist_linelist_data
The meta model method for summary estimates onlyas_epidist_meta_model.NULL
Create an 'epidist_multivariate' objectas_epidist_multivariate
Create an 'epidist_multivariate' object from a data frame of drawsas_epidist_multivariate.data.frame
Create an 'epidist_multivariate' object from a matrix of drawsas_epidist_multivariate.matrix
Convert an object to an 'epidist_naive_model' objectas_epidist_naive_model
The naive model method for 'epidist_aggregate_data' objectsas_epidist_naive_model.epidist_aggregate_data
The naive model method for 'epidist_linelist_data' objectsas_epidist_naive_model.epidist_linelist_data
Validation for epidist objectsassert_epidist
Assert validity of 'epidist_aggregate_data' objectsassert_epidist.epidist_aggregate_data
Assert validity of 'epidist_estimates_data' objectsassert_epidist.epidist_estimates_data
Assert validity of 'epidist_linelist_data' objectsassert_epidist.epidist_linelist_data
Assert validity of 'epidist_meta_model' objectsassert_epidist.epidist_meta_model
Assert validity of 'epidist_multivariate' objectsassert_epidist.epidist_multivariate
Posterior draws of the delay distribution parametersadd_delay_parameter_draws delay_parameter_draws
Posterior draws of the delay distribution, summariseddelay_summary_draws
Fit epidemiological delay distributions using a 'brms' interfaceepidist
Keep 'epidist' objects in their class$<-.epidist_data dplyr_col_modify.epidist_data dplyr_reconstruct.epidist_data dplyr_row_slice.epidist_data epidist_data group_by.epidist_data names<-.epidist_data rbind.epidist_data ungroup.epidist_data [.epidist_data [<-.epidist_data [[<-.epidist_data
Keep the 'epidist_delay_draws' class through 'dplyr' verbsdplyr_col_modify.epidist_delay_draws dplyr_reconstruct.epidist_delay_draws dplyr_row_slice.epidist_delay_draws epidist_delay_draws group_by.epidist_delay_draws names<-.epidist_delay_draws ungroup.epidist_delay_draws [.epidist_delay_draws
Diagnostics for 'epidist_fit' modelsepidist_diagnostics
Report studies from an 'epireview' parameter tableepidist_estimates_epireview
Report a study that published the parameters of a distribution it fittedepidist_estimates_parameters
Report a study that published summaries of its delaysepidist_estimates_summaries
Define 'epidist' familyepidist_family
The model-specific parts of an 'epidist_family()' callepidist_family_model
Default method for defining a model specific familyepidist_family_model.default
Create the model-specific component of an 'epidist' custom familyepidist_family_model.epidist_latent_model
Create the model-specific component of an 'epidist' custom familyepidist_family_model.epidist_marginal_model
Create the model-specific component of an 'epidist' custom familyepidist_family_model.epidist_meta_model
Default method for families which do not require a reparameterisationepidist_family_param.default
Family specific prior distributionsepidist_family_prior
Default family specific prior distributionsepidist_family_prior.default
Family specific prior distributions for the lognormal familyepidist_family_prior.lognormal
Define a model specific formulaepidist_formula
The model-specific parts of an 'epidist_formula()' callepidist_formula_model
Default method for defining a model specific formulaepidist_formula_model.default
Define the model-specific component of an 'epidist' custom formula for the latent modelepidist_formula_model.epidist_latent_model
Define the model-specific component of an 'epidist' custom formula for the marginal modelepidist_formula_model.epidist_marginal_model
Define the model-specific component of an 'epidist' custom formula for the meta modelepidist_formula_model.epidist_meta_model
Define the model-specific component of an 'epidist' custom formula for the naive modelepidist_formula_model.epidist_naive_model
Create a function to calculate the marginalised log likelihood for double censored and truncated delay distributionsepidist_gen_log_lik
Create a function to calculate the meta model log likelihoodepidist_gen_meta_log_lik
Create a function to draw from the meta model posterior predictive distributionepidist_gen_meta_predict
Create a function to draw from the expected value of the posterior predictive distribution for a modelepidist_gen_posterior_epred
Create a function to draw from the posterior predictive distribution for a double censored and truncated delay distributionepidist_gen_posterior_predict
Refit a meta model leaving each study out in turnepidist_meta_leave_one_out
Model specific prior distributionsepidist_model_prior
Default model specific prior distributionsepidist_model_prior.default
Model specific prior distributions for latent modelsepidist_model_prior.epidist_latent_model
Model specific prior distributions for the meta modelepidist_model_prior.epidist_meta_model
Build 'newdata' for prediction from an 'epidist' data objectepidist_newdata
Default method for building 'newdata'epidist_newdata.default
Build 'newdata' for the latent modelepidist_newdata.epidist_latent_model
Build 'newdata' for the marginal modelepidist_newdata.epidist_marginal_model
Build 'newdata' for the meta modelepidist_newdata.epidist_meta_model
Build 'newdata' for the naive modelepidist_newdata.epidist_naive_model
Define custom prior distributions for epidist modelsepidist_prior
Define model specific Stan codeepidist_stancode
Default method for defining model specific Stan codeepidist_stancode.default
Unique combinations of the predictors in a modelepidist_strata
The model-specific parts of an 'epidist_transform_data()' callepidist_transform_data_model
Default method for transforming data for a modelepidist_transform_data_model.default
Transform data for the marginal modelepidist_transform_data_model.epidist_marginal_model
Transform data for the meta modelepidist_transform_data_model.epidist_meta_model
Transform data for the naive modelepidist_transform_data_model.epidist_naive_model
Check if data has the 'epidist_aggregate_data' classis_epidist_aggregate_data
Check if data has the 'epidist_data' classis_epidist_data
Check if data has the 'epidist_estimates_data' classis_epidist_estimates_data
Check if data has the 'epidist_latent_model' classis_epidist_latent_model
Check if data has the 'epidist_linelist_data' classis_epidist_linelist_data
Check if data has the 'epidist_marginal_model' classis_epidist_marginal_model
Check if data has the 'epidist_meta_model' classis_epidist_meta_model
Check if an object has the 'epidist_multivariate' classis_epidist_multivariate
Check if data has the 'epidist_naive_model' classis_epidist_naive_model
Class constructor for 'epidist_aggregate_data' objectsnew_epidist_aggregate_data
Class constructor for 'epidist_estimates_data' objectsnew_epidist_estimates_data
Class constructor for 'epidist_latent_model' objectsnew_epidist_latent_model
Class constructor for 'epidist_linelist_data' objectsnew_epidist_linelist_data
Class constructor for 'epidist_marginal_model' objectsnew_epidist_marginal_model
Class constructor for 'epidist_meta_model' objectsnew_epidist_meta_model
Class constructor for 'epidist_multivariate' objectsnew_epidist_multivariate
Class constructor for 'epidist_naive_model' objectsnew_epidist_naive_model
Plot the observed delay distributionplot_delays
Default method for plotting observed delaysplot_delays.default
Plot the delays a fitted model predicts over the delays it was fitted toplot_delays.epidist_fit
Plot the observed delays of a datasetplot_delays.epidist_linelist_data
Compare the observed delays of several datasetsplot_delays.list
Plot the primary and secondary event windows of each caseplot_events
Plot posterior draws of the delay distributionautoplot.epidist_delay_draws plot.epidist_delay_draws
Print an 'epidist_multivariate' objectprint.epidist_multivariate
Ebola linelist data from Fang et al. (2016)sierra_leone_ebola_data
Convert simulated event times to datessimulate_dates
Simulate exponential casessimulate_exponential_cases
Simulate cases from a stochastic SIR modelsimulate_gillespie
Simulate secondary events based on a delay distributionsimulate_secondary
Simulate the summaries a published study would have reportedsimulate_study
Simulate cases from a uniform distributionsimulate_uniform_cases
The covariance matrix of an 'epidist_multivariate' objectvcov.epidist_multivariate