Package: EpiNow2 1.9.0.9000

Sebastian Funk

EpiNow2: Estimate and Forecast Real-Time Infection Dynamics

Estimates the time-varying reproduction number, rate of spread, and doubling time using a renewal equation approach combined with Bayesian inference via Stan. Supports Gaussian process and random walk priors for modelling changes in transmission over time. Accounts for delays between infection and observation (incubation period, reporting delays), right-truncation in recent data, day-of-week effects, and observation overdispersion. Can estimate relationships between primary and secondary outcomes (e.g., cases to hospitalisations or deaths) and forecast both. Runs across multiple regions in parallel. Based on Abbott et al. (2020) <doi:10.12688/wellcomeopenres.16006.1> and Gostic et al. (2020) <doi:10.1101/2020.06.18.20134858>.

Authors:Sam Abbott [aut], Joel Hellewell [aut], Katharine Sherratt [aut], Katelyn Gostic [aut], Joe Hickson [aut], Hamada S. Badr [aut], Michael DeWitt [aut], James M. Azam [aut], Adrian Lison [aut], Robin Thompson [ctb], Sophie Meakin [ctb], James Munday [ctb], Nikos Bosse [ctb], Paul Mee [ctb], Peter Ellis [ctb], Pietro Monticone [ctb], Lloyd Chapman [ctb], Andrew Johnson [ctb], Kaitlyn Johnson [ctb], Adam Howes [ctb], Sebastian Funk [aut, cre]

EpiNow2_1.9.0.9000.tar.gz
EpiNow2_1.9.0.9000.zip(r-4.7)EpiNow2_1.9.0.9000.zip(r-4.6)EpiNow2_1.9.0.9000.zip(r-4.5)
EpiNow2_1.9.0.9000.tgz(r-4.6-x86_64)EpiNow2_1.9.0.9000.tgz(r-4.6-arm64)EpiNow2_1.9.0.9000.tgz(r-4.5-x86_64)EpiNow2_1.9.0.9000.tgz(r-4.5-arm64)
EpiNow2_1.9.0.9000.tar.gz(r-4.7-x86_64)EpiNow2_1.9.0.9000.tar.gz(r-4.7-arm64)EpiNow2_1.9.0.9000.tar.gz(r-4.6-arm64)EpiNow2_1.9.0.9000.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
EpiNow2/json (API)
NEWS

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

Bug tracker:https://github.com/epiforecasts/epinow2/issues

Pkgdown/docs site:https://epiforecasts.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

backcalculationcovid-19gaussian-processesopen-sourcereproduction-numberstancpp

12.35 score 140 stars 388 scripts 586 downloads 7 mentions 82 exports 63 dependencies

Last updated from:4fd8834bc1. Checks:10 NOTE, 2 FAIL, 1 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE678
linux-devel-x86_64FAIL1559
source / vignettesOK989
linux-release-arm64NOTE1250
linux-release-x86_64NOTE684
macos-release-arm64NOTE405
macos-release-x86_64NOTE913
macos-oldrel-arm64NOTE391
macos-oldrel-x86_64NOTE960
windows-develNOTE965
windows-releaseNOTE910
windows-oldrelNOTE925
wasm-releaseFAIL194

Exports:add_breakpointsbackcalc_optsbootstrapped_dist_fitbound_distcalc_CrIcalc_CrIscalc_summary_measurescalc_summary_statsclean_nowcastscollapseconvert_to_logmeanconvert_to_logsdconvolve_and_scaledelay_optsDirichletdiscretisediscretizedist_fitepinowepinow2_cmdstan_modelestimate_delayestimate_distestimate_infectionsestimate_secondaryestimate_truncationExpexpose_stan_fnsextract_CrIsextract_initsextract_samplesextract_stan_paramfill_missingfilter_leading_zerosfix_parametersFixedforecast_infectionsforecast_optsforecast_secondaryGammageneration_time_optsget_distributionget_parametersget_pmfget_predictionsget_regional_resultsget_samplesgp_optsgrowth_to_Rgt_optsis_constrainedLogNormalmake_confmap_prob_changenew_dist_specNonParametricNormalobs_optsopts_listplot_estimatesplot_summaryR_to_growthregional_epinowregional_runtimesregional_summaryreport_plotsreport_summaryrt_optssecondary_optsset_dt_single_threadsetup_default_loggingsetup_futuresetup_loggingsimulate_infectionssimulate_secondarystan_laplace_optsstan_optsstan_pathfinder_optsstan_sampling_optsstan_vb_optstrunc_optsupdate_secondary_argsWeibull

Dependencies:abindbackportsBHcallrcheckmateclicpp11data.tabledescdistributionalfarverformatRfutile.loggerfutile.optionsgenericsggplot2gluegridExtragtableinlineisobandlabelinglambda.rlifecycleloolubridatemagrittrmatrixStatsnumDerivotelpatchworkpillarpkgbuildpkgconfigposteriorprimarycensoredprocessxpspurrrQuickJSRR.methodsS3R.ooR.utilsR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolsrunnerS7scalesStanHeaderstensorAtibbletimechangetruncnormutf8vctrsviridisLitewithr

Case studies and use in the literature

Rendered fromcase-studies.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-05-19
Started: 2022-10-17

Examples: estimate_infections()

Rendered fromestimate_infections_options.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2023-10-03

Fitting delay distributions with estimate_dist()

Rendered fromestimate_dist_workflow.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-05-19
Started: 2026-05-19

Forecasting multiple data streams

Rendered fromforecasting_multiple_data_streams.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2025-02-27

Gaussian Process implementation details

Rendered fromgaussian_process_implementation_details.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-05
Started: 2023-04-27

Getting started with EpiNow2

Rendered fromEpiNow2.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2024-01-09

Model definition: estimate_dist()

Rendered fromestimate_dist.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-05-19
Started: 2026-05-19

Model definition: estimate_infections()

Rendered fromestimate_infections.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-05
Started: 2022-10-17

Model definition: estimate_secondary()

Rendered fromestimate_secondary.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2025-02-03
Started: 2022-10-17

Model definition: estimate_truncation()

Rendered fromestimate_truncation.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2022-10-17

Model features

Rendered frommodel_features.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-05-19
Started: 2026-05-07

Model overview

Rendered frommodel_overview.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-05-19
Started: 2026-05-07

Prior choice and specification guide

Rendered fromprior_choice_guide.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2025-11-13

Understanding delay distributions in EpiNow2

Rendered fromdelays.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-05-19
Started: 2026-05-07

Using epinow() for running in production mode

Rendered fromepinow.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2023-10-03

Workflow for Rt estimation and forecasting

Rendered fromestimate_infections_workflow.Rmdusingknitr::rmarkdownon Jun 18 2026.

Last update: 2026-06-17
Started: 2023-10-03

Readme and manuals

Help Manual

Help pageTopics
Creates a delay distribution as the sum of two other delay distributions.+.dist_spec
Compares two delay distributions!=.dist_spec ==.dist_spec
Add breakpoints to certain dates in a data set.add_breakpoints
Convert zero case counts to 'NA' (missing) if the 7-day average is above a threshold.apply_zero_threshold
Convert EpiNow2 model output to a 'forecast_sample' objectas_forecast_sample as_forecast_sample.epinow as_forecast_sample.estimate_infections as_forecast_sample.estimate_truncation as_forecast_sample.forecast_secondary
Back Calculation Optionsbackcalc_opts
Fit a Subsampled Bootstrap to Integer Values and Summarise Distribution Parametersbootstrapped_dist_fit
Define bounds of a <dist_spec>bound_dist
Combines multiple delay distributions for further processingc.dist_spec
Calculate Credible Intervalcalc_CrI
Calculate Credible Intervalscalc_CrIs
Calculate All Summary Measurescalc_summary_measures
Calculate Summary Statisticscalc_summary_stats
Clean Nowcasts for a Supplied Dateclean_nowcasts
Clean Regionsclean_regions
Collapse nonparametric distributions in a <dist_spec>collapse collapse.dist_spec
Convert mean and sd to log mean for a log normal distributionconvert_to_logmean
Convert mean and sd to log standard deviation for a log normal distributionconvert_to_logsd
Convolve and scale a time seriesconvolve_and_scale
Delay Distribution Optionsdelay_opts
Discretise a <dist_spec>discretise discretise.dist_spec discretize
Fit an Integer Adjusted Exponential, Gamma or Lognormal distributionsdist_fit
Probability distributionsDirichlet Distributions Exp Fixed Gamma LogNormal NonParametric Normal Weibull
Real-time Rt Estimation, Forecasting and Reportingepinow
Load and compile an EpiNow2 cmdstanr modelepinow2_cmdstan_model
Estimate a Delay Distributionestimate_delay
Estimate a delay distribution using primarycensoredestimate_dist
Estimate Infections, the Time-Varying Reproduction Number and the Rate of Growthestimate_infections
Estimate a Secondary Observation from a Primary Observationestimate_secondary
Estimate truncation of observed dataestimate_truncation
Example Confirmed Case Data Setexample_confirmed
Example generation timeexample_generation_time
Example incubation periodexample_incubation_period
Example reporting delayexample_reporting_delay
Example Case Data Set with Truncationexample_truncated
Expose internal package stan functions in Rexpose_stan_fns
Extract Credible Intervals Presentextract_CrIs
Generate initial conditions from a Stan fitextract_inits
Extract all samples from a stan fitextract_samples
Extract a parameter summary from a Stan objectextract_stan_param
Fill missing data in a data set to prepare it for use within the packagefill_missing
Filter leading zeros from a data set.filter_leading_zeros
Filter Options for a Target Regionfilter_opts
Fix the parameters of a <dist_spec>fix_parameters fix_parameters.dist_spec
Forecast infections from a given fit and trajectory of the time-varying reproduction numberforecast_infections
Forecast optionsforecast_opts
Forecast Secondary Observations Given a Fit from estimate_secondaryforecast_secondary
Get the distribution of a <dist_spec>get_distribution
Get parameters from distributions or fitted modelsget_parameters get_parameters.dist_spec get_parameters.epinowfit get_parameters.estimate_dist
Get the probability mass function of a nonparametric distributionget_pmf
Get predictions from a fitted modelget_predictions get_predictions.estimate_infections get_predictions.estimate_secondary get_predictions.estimate_truncation get_predictions.forecast_infections get_predictions.forecast_secondary
Get Combined Regional Resultsget_regional_results
Get posterior samples from a fitted modelget_samples get_samples.epinow get_samples.estimate_infections get_samples.estimate_secondary get_samples.estimate_truncation get_samples.forecast_infections get_samples.forecast_secondary
Approximate Gaussian Process Settingsgp_opts
Convert Growth Rates to Reproduction numbers.growth_to_R
Generation Time Distribution Optionsgeneration_time_opts gt_opts
Check if a <dist_spec> is constrained, i.e. has a finite maximum or nonzero CDF cutoff.is_constrained is_constrained.dist_spec
Format Credible Intervalsmake_conf
Categorise the Probability of Change for Rtmap_prob_change
Returns the maximum of one or more delay distributionmax.dist_spec
Returns the mean of one or more delay distributionmean.dist_spec
Internal function for generating a 'dist_spec' given parameters and a distribution.new_dist_spec
Observation Model Optionsobs_opts
Forecast optiongopts_list
Plot EpiNow2 Credible Intervalsplot_CrIs
Plot Estimatesplot_estimates
Plot a Summary of the Latest Resultsplot_summary
Plot PMF and CDF for a dist_spec objectplot.dist_spec
Plot method for estimate_infectionsplot.estimate_infections
Plot method for estimate_secondaryplot.estimate_secondary
Plot method for estimate_truncationplot.estimate_truncation
Plot method for forecast_infectionsplot.forecast_infections
Plot method for forecast_secondary objectsplot.forecast_secondary
Prints the parameters of one or more delay distributionsprint.dist_spec
Print information about an object that has resulted from a model fit.print.epinowfit
Convert Reproduction Numbers to Growth RatesR_to_growth
Real-time Rt Estimation, Forecasting and Reporting by Regionregional_epinow
Regional Summary Outputregional_summary
Report plotsreport_plots
Provide Summary Statistics for Estimated Infections and Rtreport_summary
Time-Varying Reproduction Number Optionsrt_opts
Run epinow with Regional Processing Coderun_region
Secondary Reports Optionssecondary_opts
Setup Default Loggingsetup_default_logging
Set up Future Backendsetup_future
Setup Loggingsetup_logging
Simulate infections using the renewal equationsimulate_infections
Simulate secondary observations from primary observationssimulate_secondary
Stan Laplace algorithm Optionsstan_laplace_opts
Stan Optionsstan_opts
Stan pathfinder algorithm Optionsstan_pathfinder_opts
Stan Sampling Optionsstan_sampling_opts
Stan Variational Bayes Optionsstan_vb_opts
Summary output from epinowsummary summary.epinow
Summarise results from estimate_distsummary.estimate_dist
Summary output from estimate_infectionssummary.estimate_infections
Summarise results from estimate_secondarysummary.estimate_secondary
Summarise results from estimate_truncationsummary.estimate_truncation
Summary output from forecast_infectionssummary.forecast_infections
Truncation Distribution Optionstrunc_opts
Update estimate_secondary default priorsupdate_secondary_args