Package: epinowcast 0.6.0.1000

Sam Abbott

epinowcast: A Bayesian Framework for Real-time Infectious Disease Surveillance

A modular Bayesian framework for real-time infectious disease surveillance. Provides tools for nowcasting, reproduction number estimation, delay estimation, and forecasting from data subject to reporting delays, right-truncation, missing data, and incomplete ascertainment. Users can build models suited to their setting using a flexible formula interface supporting fixed effects, random effects, random walks, and time-varying parameters, with options including parametric and non-parametric delay distributions with optional modifiers (via discrete-time hazard models), renewal processes, observation models, missing data imputation, and stratified analyses with partial pooling. By jointly estimating disease dynamics and reporting patterns, our framework enables earlier and more reliable detection of trends. While designed with epidemiological applications in mind, the framework can be applied to any right-truncated time series count data.

Authors:Sam Abbott [aut, cre], Adrian Lison [aut], Sebastian Funk [aut], Carl Pearson [aut], Hugo Gruson [aut], Felix Guenther [aut], Michael DeWitt [aut], James Mba Azam [aut], Jessalyn Sebastian [aut], Hannah Choi [ctb], Pratik Gupte [ctb], Joel Hellewell [ctb], Luis Rivas [ctb], Sang Woo Park [ctb], Nathan McIntosh [ctb], Kath Sherratt [ctb], Nikos Bosse [ctb], Adam Howes [ctb], Kaitlyn Johnson [ctb], Barbora Nemcova [ctb]

epinowcast_0.6.0.1000.tar.gz
epinowcast_0.6.0.1000.zip(r-4.7)epinowcast_0.6.0.1000.zip(r-4.6)epinowcast_0.6.0.1000.zip(r-4.5)
epinowcast_0.6.0.1000.tgz(r-4.6-any)epinowcast_0.6.0.1000.tgz(r-4.5-any)
epinowcast_0.6.0.1000.tar.gz(r-4.7-any)epinowcast_0.6.0.1000.tar.gz(r-4.6-any)
epinowcast_0.6.0.1000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
epinowcast/json (API)
NEWS

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

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

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

Datasets:

On CRAN:

Conda:

cmdstanreffective-reproduction-number-estimationepidemiologyinfectious-disease-surveillancenowcastingoutbreak-analysispandemic-preparednessreal-time-infectious-disease-modellingstan

9.10 score 65 stars 88 scripts 86 exports 38 dependencies

Last updated from:54492aaf5b. Checks:9 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK349
source / vignettesOK279
linux-release-x86_64OK361
macos-release-arm64OK317
macos-oldrel-arm64OK342
windows-develOK320
windows-releaseOK289
windows-oldrelOK315
wasm-releaseOK150

Exports:add_pmfsararimaarmacheck_max_delaycoerce_dateconvolution_matrixenw_add_cumulativeenw_add_cumulative_membershipenw_add_delayenw_add_incidenceenw_add_latest_obs_to_nowcastenw_add_max_reportedenw_add_metaobs_featuresenw_add_pooling_effectenw_aggregate_cumulativeenw_assign_groupenw_complete_datesenw_construct_dataenw_dayofweek_structural_reportingenw_delay_categoriesenw_delay_quantilesenw_designenw_effects_metadataenw_exampleenw_expectationenw_extend_dateenw_filter_delayenw_filter_reference_datesenw_filter_reference_dates_by_report_startenw_filter_report_datesenw_fit_optsenw_flag_observed_observationsenw_formulaenw_formula_as_data_listenw_get_cacheenw_get_dataenw_impute_na_observationsenw_incidence_to_linelistenw_latest_dataenw_linelist_to_incidenceenw_manual_formulaenw_metadataenw_metadata_delayenw_missingenw_missing_referenceenw_modelenw_nowcast_samplesenw_nowcast_summaryenw_obsenw_obs_at_delayenw_one_hot_encode_featureenw_pathfinderenw_plot_delay_countsenw_plot_delay_cumulativeenw_plot_delay_fractionenw_plot_delay_quantilesenw_plot_nowcast_quantilesenw_plot_obsenw_plot_pp_quantilesenw_plot_quantilesenw_plot_themeenw_posteriorenw_pp_summaryenw_preprocess_dataenw_priors_as_data_listenw_quantiles_to_longenw_referenceenw_replace_priorsenw_reportenw_reporting_triangleenw_reporting_triangle_to_longenw_retrospectiveenw_rolling_sumenw_sampleenw_set_cacheenw_simulate_missing_referenceenw_stan_to_renw_structural_reporting_metadataenw_summarise_samplesenw_unset_cacheepinowcastextract_sparse_matrixmarerw

Dependencies:abindbackportscheckmateclicpp11data.tabledistributionalfarvergenericsggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMatrixmatrixStatsnumDerivpillarpkgconfigposteriorpurrrR6rbibutilsRColorBrewerRdpackreformulasrlangS7scalestensorAtibbleutf8vctrsviridisLitewithr

ARIMA latent residuals: maths, priors, and usage

Rendered fromarima.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-06-04
Started: 2026-06-04

Comparing Inference Methods

Rendered frominference-methods.Rmdusingknitr::rmarkdownon Jun 04 2026.

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

Discretised distributions

Rendered fromdistributions.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2024-01-03
Started: 2023-04-28

Estimating the effective reproduction number in real-time for a single timeseries with reporting delays

Rendered fromsingle-timeseries-rt-estimation.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-04-21
Started: 2023-09-05

Getting Started with Epinowcast: Nowcasting

Rendered fromepinowcast.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-05-05
Started: 2023-11-22

Hierarchical nowcasting of age stratified COVID-19 hospitalisations in Germany

Rendered fromgermany-age-stratified-nowcasting.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-02-16
Started: 2021-11-01

Latent process and periodic options for the growth-rate model

Rendered fromlatent-processes.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-06-04
Started: 2026-06-04

Model definition and implementation

Rendered frommodel.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-06-04
Started: 2021-11-04

Model Features Summary

Rendered fromfeatures.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-06-04
Started: 2025-10-10

Case studies

Rendered frompackage-use-cases.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-02-13
Started: 2024-09-02

Resources to help with model fitting using Stan

Rendered fromstan-help.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-04-02
Started: 2023-12-13

Temporal aggregation guide

Rendered fromtemporal-aggregation.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-05-05
Started: 2026-05-01

Visualising Preprocessed Data

Rendered frompreprocess-visualisation.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-05-05
Started: 2026-04-16

Readme and manuals

Help Manual

Help pageTopics
Add maximum observed delayadd_max_observed_delay
Add probability mass functionsadd_pmfs
Autoregressive alias for 'arima()'ar
Adds an ARIMA(p, d, q) latent residual to the model.arima
Finds ARIMA terms in a formula objectarima_terms
ARMA alias for 'arima()'arma
Convert an epinowcast object to a forecast_sample objectas_forecast_sample.epinowcast
Converts formulas to stringsas_string_formula
Build the ord_obs 'data.table'.build_ord_obs
Check design matrix sparsitycheck_design_matrix_sparsity
Check observations for reserved grouping variablescheck_group
Check observations for uniqueness of grouping variables with respect to 'reference_date' and 'report_date'check_group_date_unique
Check appropriateness of maximum delaycheck_max_delay
Check a model module contains the required componentscheck_module
Check that model modules have compatible specificationscheck_modules_compatible
Check Numeric Timestepcheck_numeric_timestep
Check observation indicatorcheck_observation_indicator
Check required quantiles are presentcheck_quantiles
Check timestepcheck_timestep
Check timestep by datecheck_timestep_by_date
Check timestep by groupcheck_timestep_by_group
Coerce Datescoerce_date
Coerce 'data.table'scoerce_dt
Constructs ARIMA term metadataconstruct_arima
Constructs random effect termsconstruct_re
Constructs random walk termsconstruct_rw
Construct a convolution matrixconvolution_matrix
Convert date column to numeric and calculate its modulus with given timestep.date_to_numeric_modulus
Calculate cumulative reported cases from incidence of new reportsenw_add_cumulative
Add a cumulative membership effect to a 'data.frame'enw_add_cumulative_membership
Add a delay variable to the observationsenw_add_delay
Calculate incidence of new reports from cumulative reportsenw_add_incidence
Add latest observations to nowcast outputenw_add_latest_obs_to_nowcast
Add the maximum number of reported cases for each 'reference_date'enw_add_max_reported
Add common metadata variablesenw_add_metaobs_features
Add a pooling effect to model design metadataenw_add_pooling_effect
Aggregate observations over a given timestep for both report and reference dates.enw_aggregate_cumulative
Assign a group to each row of a data.tableenw_assign_group
Complete missing reference and report datesenw_complete_dates
Construct preprocessed dataenw_construct_data
Create day-of-week structural reporting patternenw_dayofweek_structural_reporting
Categorise new confirmations by delay groupenw_delay_categories
Empirical delay quantiles by reference dateenw_delay_quantiles
A helper function to construct a design matrix from a formulaenw_design
Extracts metadata from a design matrixenw_effects_metadata
Load a package exampleenw_example
Expectation model moduleenw_expectation
Extend a time series with additional datesenw_extend_date
Filter observations to have a consistent maximum delay periodenw_filter_delay
Filter by reference datesenw_filter_reference_dates
Filter reference dates that precede the earliest report dateenw_filter_reference_dates_by_report_start
Filter by report datesenw_filter_report_dates
Format model fitting options for use with stanenw_fit_opts
Flag observed observationsenw_flag_observed_observations
Define a model using a formula interfaceenw_formula
Format formula data for use with stanenw_formula_as_data_list
Retrieve Stan cache locationenw_get_cache
Extract data from preprocessed nowcast objectsenw_get_data
Impute NA observationsenw_impute_na_observations
Convert Aggregate Counts (Incidence) to a Line Listenw_incidence_to_linelist
Filter observations to the latest available reportedenw_latest_data
Convert a Line List to Aggregate Counts (Incidence)enw_linelist_to_incidence
Define a model manually using fixed and random effectsenw_manual_formula
Extract metadata from raw dataenw_metadata
Calculate reporting delay metadata for a given maximum delayenw_metadata_delay
Missing reference data model moduleenw_missing
Extract reports with missing reference datesenw_missing_reference
Load and compile the nowcasting modelenw_model
Extract posterior samples for the nowcast predictionenw_nowcast_samples
Summarise the posterior nowcast predictionenw_nowcast_summary
Setup observation model and dataenw_obs
Extract latest observations at a given maximum delayenw_obs_at_delay
One-hot encode a variable and column-bind it to the original data.tableenw_one_hot_encode_feature
Fit a CmdStan model using the pathfinder algorithmenw_pathfinder
Plot notifications by delay groupenw_plot_delay_counts
Plot cumulative empirical reporting delayenw_plot_delay_cumulative
Plot empirical reporting delay heatmapenw_plot_delay_fraction
Plot empirical reporting delay quantilesenw_plot_delay_quantiles
Plot nowcast quantilesenw_plot_nowcast_quantiles
Generic quantile plotenw_plot_obs
Plot posterior prediction quantilesenw_plot_pp_quantiles
Generic quantile plotenw_plot_quantiles
Package plot themeenw_plot_theme
Summarise the posteriorenw_posterior
Posterior predictive summaryenw_pp_summary
Preprocess observationsenw_preprocess_data
Convert prior 'data.frame' to listenw_priors_as_data_list
Convert summarised quantiles from wide to long formatenw_quantiles_to_long
Reference date logit hazard reporting model moduleenw_reference
Construct a lookup of references dates by reportenw_reference_by_report
Replace default priors with user specified priorsenw_replace_priors
Report date logit hazard reporting model moduleenw_report
Construct the reporting triangleenw_reporting_triangle
Recast the reporting triangle from wide to long formatenw_reporting_triangle_to_long
Identify report dates with complete (i.e up to the maximum delay) reference datesenw_reps_with_complete_refs
Convert preprocessed data to retrospective formatenw_retrospective
Perform rolling sum aggregationenw_rolling_sum
Fit a CmdStan model using NUTSenw_sample
Set caching location for Stan modelsenw_set_cache
Simulate observations with a missing reference date.enw_simulate_missing_reference
Expose 'epinowcast' stan functions in Renw_stan_to_r
Create structural reporting metadata gridenw_structural_reporting_metadata
Summarise posterior samplesenw_summarise_samples
Unset Stan cache locationenw_unset_cache
Nowcast using partially observed dataepinowcast
Extract observation metadataextract_obs_metadata
Extract sparse matrix elementsextract_sparse_matrix
Hospitalisations in Germany by date of report and referencegermany_covid19_hosp
Get internal timestepget_internal_timestep
Check an object is a Dateis.Date
Convert latest observed data to a matrixlatest_obs_as_matrix
Moving-average alias for 'arima()'ma
Parse a formula into componentsparse_formula
Plot method for enw_preprocess_dataplot.enw_preprocess_data
Plot method for epinowcastplot.epinowcast
Print method for enw_preprocess_dataprint.enw_preprocess_data
Print method for epinowcastprint.epinowcast
Print method for summary.enw_preprocess_dataprint.summary.enw_preprocess_data
Defines random effect terms using the lme4 syntaxre
Remove ARIMA terms from a formula objectremove_arima_terms
Remove profiling statements from a character vector representing stan coderemove_profiling
Remove random walk terms from a formula objectremove_rw_terms
Adds random walks with Gaussian steps to the model.rw
Finds random walk terms in a formula objectrw_terms
Split formula into individual termssplit_formula_to_terms
Read in a stan function file as a character stringstan_fns_as_string
Subset observations data table for either modelled dates or not-modelled earlier dates.subset_obs
Summary method for enw_preprocess_datasummary.enw_preprocess_data
Summary method for epinowcastsummary.epinowcast
Write copies of the .stan files of a Stan model and its #include files with all profiling statements removed.write_stan_files_no_profile