Package: diseasenowcasting 2.4.0

diseasenowcasting: Nowcast Time Series of Epidemiological Cases

Implements Bayesian nowcasting models for incident disease cases using a censored point-process approach. The reporting delay is modelled directly as a stochastic process, jointly with the epidemic dynamics, via a censored likelihood. Inference uses RTMB (CppAD autodiff + Laplace approximation). Supports arbitrary epidemic models (including HSGP, AR1, SIR), arbitrary delay families (including LogNormal, GenGamma, Dirichlet), stratified data, extreme-delay detection, and backtesting.

Authors:Rodrigo Zepeda-Tello [aut, cre], Rami Yaari [aut], Matteo Perini [aut], Tal Robin [ctb], Teresa Yamana [ctb], Jeffrey Shaman [ctb], Columbia University in the City of New York [cph, fnd]

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

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

Bug tracker:https://github.com/rodrigozepeda/diseasenowcasting/issues

Pkgdown/docs site:https://rodrigozepeda.github.io

Datasets:

On CRAN:

Conda:

bayesian-nowcastingbayesian-statisticsdisease-monitoringepidemic-surveillanceepidemiological-modelsepidemiologynowcastnowcastingnowcasting-modelspublic-healthpublic-health-surveillancertmbtime-series

5.26 score 6 stars 19 scripts 67 exports 67 dependencies

Last updated from:d90a3e36af. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK269
source / vignettesOK319
linux-releaseOK353
macos-releaseOK198
macos-oldrelOK279
windows-develOK306
windows-releaseOK341
windows-oldrelOK301
wasm-releaseOK185

Exports:ar1_epidemicauto_nowcastautoplotbacktestbest_modelbest_model_namebest_scorebeta_priorcauchy_priorchi_square_priorcomparison_scorescumulative_processcustom_delaycustom_epidemicdefault_priorsdirichlet_delaydirichlet_revisiondn_palettedouble_exponential_priorexponential_priorextreme_valuesfitfit_checkfix_paramflat_priorgamma_delaygamma_priorgamma_revisiongeneralized_gamma_delaygeneralized_gamma_revisionhalf_cauchy_priorhalf_double_exponential_priorhalf_normal_priorhalf_std_normal_priorhalf_student_t_priorhsgp_epidemicinfer_max_timeinv_gamma_priorload_nowcastlogistic_priorlognormal_delaylognormal_priorlognormal_revisionmodelnb_likelihoodnormal_priornowcastnowcast_diagnosticnowcast_twostageparameterspoisson_likelihoodpositive_flat_priorprepare_datarevision_processsamplesave_nowcastselection_metricselection_timingssir_epidemicstd_normal_priorstudent_t_priorsummarise_nowcast_matrixsurprisetheme_diseasenowcastingvalidate_custom_delayvalidate_custom_epidemicweibull_prior

Dependencies:backportsbootcheckmatecircularcliclueclustercpp11data.tabledplyrevaluatefarvergenericsggplot2gluegtablehighrisobandknitrlabelinglatticelifecyclelubridatemagrittrMASSMatrixMatrixModelsmnormtmovMFmvtnormnumDerivpillarpkgconfigpurrrquantregR6RColorBrewerRcppRcppArmadilloRcppEigenrlangRTMBRTMBdistS7scalesscoringRulesscoringutilsskmeansslamsnSparseMstatmodstringistringrsurvivaltbl.nowtibbletidyrtidyselecttimechangeTMButf8vctrsviridisLitewithrxfunyaml

Introduction to diseasenowcasting: Real-Time Epidemic Nowcasting
Native modelling and the shared workflow | Your data: the tbl_now format | Example 1 -- Dengue fever (setting up a stratified nowcast) | Example 2 -- Mpox (modifying the nowcast model) | Example 3 -- Comparing models with a backtest | When a report is not yet a case: the revision process | Example 4 -- Letting the package choose the model (auto_nowcast()) | Updating the chosen model as new data arrive | Example 5 -- Count-cumulative revisions and a historical origin | Saving and loading a fitted nowcast | Combining diseasenowcasting models in an ensemble | Next steps

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

Nowcasting at the Start of an Epidemic
TL;DR | The challenge: few data points | 0) Prelude: Data preparation | 1) Prior choices at the start of an epidemic | 1.1 The SIR model: mechanistic priors | 1.2 The AR(1) model: trend priors | 1.3 The HSGP model: kernel priors | 2) Experiments with the prior: prior-predictive simulation | 2.1) SIR -- moving R0. | 2) COVID-19 Colombia: example from 1 day to 3 months | 2.2 Fitting each model across the four windows | 2.3 Comparing the three models across windows | 2.4 A rule of thumb | 3) Conclusion: When to fit what?

Last update: 2026-09-09
Started: 2026-06-03

Custom Delays and Epidemic Processes
The one rule: RTMB | 1. Custom delay: Weibull | The data | The custom part: a Weibull delay | Fit it (and a built-in to compare against) | 2. Custom epidemic: different SIR | The custom part: an SIR epidemic | Fit it | 3. Summary: Tips for writing your own component | 4. Advanced: A differential equations epidemic process

Last update: 2026-06-22
Started: 2026-06-16

Understanding Priors and Hyperparameters in diseasenowcasting
Quick reference | What the rest of the vignette shows: | 1. Likelihood prior: NB precision (phi) | 2. Reporting-delay parameters | 2.1 Log-Normal delay | 2.1.1 Location (mu) | 2.1.2 Scale (sigma) | 2.2 Generalized-Gamma delay | 2.2.1 Location (mu) | 2.2.2 Scale (sigma) | 2.2.3 Tail shape (Q) | 2.3 Dirichlet (non-parametric) delay | 2.3.1 Concentration (alpha) | 3. Epidemic-process parameters | 3.1 HSGP | 3.1.1 Amplitude (alpha) | 3.1.2 Length-scale (ell) | 3.1.4 HSGP: number of basis functions (num_basis) | 3.2 AR(1) | 3.2.1 Autocorrelation (phi) | 3.2.2 Innovation SD (sigma) | 3.3 SIR | 3.3.1 Basic reproduction number (R0) | 3.3.2 Recovery rate (gamma) | 3.3.3 Susceptible fraction (N_eff) | 3.3.4 Total population (N_pop) | 4. Covariate priors (covariate_prior) | 5. Practical guide

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

Readme and manuals

Help Manual

Help pageTopics
Automatically select and fit the best nowcasting modelauto_nowcast
Backtest one or more diseasenowcasting modelsbacktest
The winning 'model()' object from a nowcastbest_model
Name of the model chosen by 'auto_nowcast()'best_model_name
The scoreboard row for the model 'auto_nowcast()' chosebest_score
The model-selection scoreboard from 'auto_nowcast()'comparison_scores
COVID-19 Notifications - Colombia 2020-2023covid_colombia
Count-cumulative observation processcumulative_process
User-defined delay distributioncustom_delay
User-defined epidemic processcustom_epidemic
Build the default prior bundle for an RTMB nowcast modeldefault_priors
Delay distribution for the Bayesian Nowcastdelay_process dirichlet_delay gamma_delay generalized_gamma_delay lognormal_delay
Native and cross-engine workflowsdiseasenowcasting_workflows
diseasenowcasting colour palettedn_palette
Epidemic process for the Bayesian Nowcastar1_epidemic epidemic_process hsgp_epidemic sir_epidemic
Surprising (extreme) values flagged during the last 'update()'extreme_values
Fit a nowcast model with the RTMB enginefit
Check RTMB optimizer diagnostics for a fitted nowcastfit_check
Hard-fix a parameter in a prior bundle (treat as data, drop from estimation)fix_param
Infer 'max_time' for custom epidemic processesinfer_max_time
Likelihood for the Bayesian Nowcastlikelihood nb_likelihood poisson_likelihood
Load a nowcast saved with 'save_nowcast()'load_nowcast
Bayesian Nowcast Modelmodel
Fit a nowcast model to censored reporting datanowcast
Three-panel diagnostic plot for a fitted nowcastnowcast_diagnostic
Two-stage multiple-imputation nowcastnowcast_twostage
Parameter estimates from a fitted nowcastparameters
Prepare data for the RTMB nowcast engineprepare_data
Priors for model parametersbeta_prior cauchy_prior chi_square_prior double_exponential_prior exponential_prior flat_prior gamma_prior half_cauchy_prior half_double_exponential_prior half_normal_prior half_std_normal_prior half_student_t_prior inv_gamma_prior logistic_prior lognormal_prior normal_prior positive_flat_prior priors std_normal_prior student_t_prior weibull_prior
Revision-lag distributionsdirichlet_revision gamma_revision generalized_gamma_revision lognormal_revision revision_delay
Revision process: reports that are later confirmed or retractedrevision_process
Draw random samples from a prior (or fall back to 'base::sample()')sample
Save a fitted nowcast to disksave_nowcast
The metric 'auto_nowcast()' used to pick the winnerselection_metric
Fitting times recorded by 'auto_nowcast()'selection_timings
Quantile-table summary of a pooled nowcast draws matrixsummarise_nowcast_matrix
Compute surprise scores for new observationssurprise
Surprise score on a raw fit() resultsurprise.list
ggplot2 theme matching the diseasenowcasting visual identitytheme_diseasenowcasting
Validate a custom delay distribution for RTMB traceabilityvalidate_custom_delay
Validate a user-defined epidemic process for RTMB traceabilityvalidate_custom_epidemic