Package: baselinenowcast 0.2.0

Kaitlyn Johnson

baselinenowcast: Baseline Nowcasting for Right-Truncated Epidemiological Data

Nowcasting right-truncated epidemiological data is critical for timely public health decision-making, as reporting delays can create misleading impressions of declining trends in recent data. This package provides nowcasting methods based on using empirical delay distributions and uncertainty from past performance. It is also designed to be used as a baseline method for developers of new nowcasting methods. For more details on the performance of the method(s) in this package applied to case studies of COVID-19 and norovirus, see our recent paper at <https://wellcomeopenresearch.org/articles/10-614>. The package supports standard data frame inputs with reference date, report date, and count columns, as well as the direct use of reporting triangles, and is compatible with 'epinowcast' objects. Alongside an opinionated default workflow, it has a low-level pipe-friendly modular interface, allowing context-specific workflows. It can accommodate a wide spectrum of reporting schedules, including mixed patterns of reference and reporting (daily-weekly, weekly-daily). It also supports sharing delay distributions and uncertainty estimates between strata, as well as custom uncertainty models and delay estimation methods.

Authors:Kaitlyn Johnson [aut, cre, cph], Emily Tyszka [aut], Johannes Bracher [aut], Sebastian Funk [aut], Sam Abbott [aut], Tim Taylor [ctb]

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

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

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

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

Datasets:
  • example_downward_corr_rt - Example reporting triangle with downward corrections
  • example_reporting_triangle - Simple example reporting triangle for demonstrations
  • germany_covid19_hosp - Incident COVID-19 hospitalisations indexed by the date of positive test (reference date) and report date from Germany in 2021 and 2022.
  • syn_nssp_df - A synthetic dataset containing the number of incident cases indexed by reference date and report date. While data of this form could be from any source, this data is meant to represent the output of pre-processing the syn_nssp_line_list dataset, which is a synthetic patient-level line list data from the United State's National Syndromic Surveillance System (NSSP).
  • syn_nssp_line_list - A synthetic dataset resembling line-list (each row is a patient) data from the United States' National Syndromic Surveillance System (NSSP) accessed via the Essence platform. All entries are synthetic, formatted to look as close to the real raw data as possible.

On CRAN:

Conda:

7.69 score 9 stars 15 scripts 210 downloads 40 exports 9 dependencies

Last updated from:cc398eb63c (on v0.2.0). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK279
source / vignettesOK246
linux-release-x86_64OK266
macos-release-arm64OK326
macos-oldrel-arm64OK346
windows-develOK255
windows-releaseOK314
windows-oldrelOK308
wasm-releaseOK131

Exports:allocate_reference_timesapply_delayapply_reporting_structureapply_reporting_structuresas_ChainLadder_triangleas_reporting_triangleassert_baselinenowcast_dfassert_reporting_trianglebaselinenowcastcombine_obs_with_predestimate_and_apply_delayestimate_and_apply_delaysestimate_and_apply_uncertaintyestimate_delayestimate_uncertaintyestimate_uncertainty_retrofit_by_horizonfit_nbget_delays_from_datesget_delays_unitget_max_delayget_mean_delayget_quantile_delayget_reference_datesget_report_datesget_reporting_structureis_reporting_trianglenew_baselinenowcast_dfnew_reporting_trianglepreprocess_negative_valuessample_nbsample_nowcastsample_nowcastssample_predictionsample_predictionstruncate_to_delaytruncate_to_quantiletruncate_to_rowtruncate_to_rowsvalidate_reporting_triangle

Dependencies:backportscheckmatecligluelifecyclemagrittrpurrrrlangvctrs

Getting Started with baselinenowcast

Rendered frombaselinenowcast.Rmdusingknitr::rmarkdownon May 05 2026.

Last update: 2026-01-15
Started: 2025-01-29

Mathematical methods for baselinenowcast

Rendered frommodel_definition.Rmdusingknitr::rmarkdownon May 05 2026.

Last update: 2025-12-22
Started: 2025-03-04

Modular workflow demonstration

Rendered frommodular_workflow.Rmdusingknitr::rmarkdownon May 05 2026.

Last update: 2026-01-27
Started: 2025-11-13

Nowcasting nomenclature

Rendered fromnomenclature.Rmdusingknitr::rmarkdownon May 05 2026.

Last update: 2025-07-28
Started: 2025-07-01

Nowcasting syndromic surveillance system data: a case study applied to the U.S. National Syndromic Surveillance Program (NSSP) data

Rendered fromnssp_nowcast.Rmdusingknitr::rmarkdownon May 05 2026.

Last update: 2026-01-29
Started: 2025-10-08

Readme and manuals

Help Manual

Help pageTopics
Subset reporting_triangle objects[.reporting_triangle
Subset assignment for reporting_triangle objects[<-.reporting_triangle
Allocate training volume based on combination of defaults and user-specified values for training volume for delay and uncertainty estimation.allocate_reference_times
Apply the delay to generate a point nowcastapply_delay
Apply reporting structure to generate a single retrospective reporting triangleapply_reporting_structure
Apply reporting structures to generate retrospective reporting trianglesapply_reporting_structures
Convert reporting_triangle to ChainLadder triangle formatas_ChainLadder_triangle
Create a 'reporting_triangle' objectas_reporting_triangle
Create a 'reporting_triangle' object from a data.frameas_reporting_triangle.data.frame
Create a 'reporting_triangle' from a matrixas_reporting_triangle.matrix
Convert ChainLadder triangle to reporting_triangle formatas_reporting_triangle.triangle
Convert reporting_triangle to data.frameas.data.frame.reporting_triangle
Convert reporting_triangle to plain matrixas.matrix.reporting_triangle
Assert validity of 'baselinenowcast_df' objectsassert_baselinenowcast_df
Assert validity of 'reporting_triangle' objectsassert_reporting_triangle
Generate a nowcastbaselinenowcast
Nowcast Data.frame Objectbaselinenowcast_df baselinenowcast_df-class
Create a dataframe of nowcast results from a dataframe of cases indexed by reference date and report datebaselinenowcast.data.frame
Create a dataframe of nowcast results from a single reporting trianglebaselinenowcast.reporting_triangle
Combine observed data with a single prediction drawcombine_obs_with_pred
Estimate and apply delay from a reporting triangleestimate_and_apply_delay
Estimate and apply delays to generate retrospective nowcastsestimate_and_apply_delays
Estimate and apply uncertainty to a point nowcast matrixestimate_and_apply_uncertainty
Estimate a delay distribution from a reporting triangleestimate_delay
Estimate uncertainty parametersestimate_uncertainty
Estimate uncertainty parameters using retrospective nowcastsestimate_uncertainty_retro
Example reporting triangle with downward correctionsexample_downward_corr_rt
Simple example reporting triangle for demonstrationsexample_reporting_triangle
Helper function that fits its each column of the matrix (horizon) to an observation model.fit_by_horizon
Fit a negative binomial to a vector of observations and expectationsfit_nb
Incident COVID-19 hospitalisations indexed by the date of positive test (reference date) and report date from Germany in 2021 and 2022.germany_covid19_hosp
Compute delays between report dates and reference datesget_delays_from_dates
Get delays unit from a reporting triangleget_delays_unit
Get maximum delay from reporting_triangleget_max_delay
Get mean delay for each row of reporting_triangleget_mean_delay
Get quantile delay for each row of reporting_triangleget_quantile_delay
Get reference dates from reporting_triangleget_reference_dates
Compute report dates from reference dates and delaysget_report_dates
Get reporting structure from a reporting triangleget_reporting_structure
Get first rows of a reporting_trianglehead.reporting_triangle
Check if an object is a reporting_triangleis_reporting_triangle
Combine data from a nowcast dataframe, strata, and reference datesnew_baselinenowcast_df
Class constructor for 'reporting_triangle' objectsnew_reporting_triangle
Preprocess negative values in the reporting trianglepreprocess_negative_values
Print a reporting_triangle objectprint.reporting_triangle
Reporting Triangle Objectreporting_triangle reporting_triangle-class
Sample from negative binomial model given a set of predictionssample_nb
Generate a single draw of a nowcast combining observed and predicted valuessample_nowcast
Generate multiple draws of a nowcast combining observed and predicted valuessample_nowcasts
Get a draw of only the predicted elements of the nowcast vectorsample_prediction
Get a dataframe of multiple draws of only the predicted elements of the nowcast vectorsample_predictions
Summarize a reporting_triangle objectsummary.reporting_triangle
A synthetic dataset containing the number of incident cases indexed by reference date and report date. While data of this form could be from any source, this data is meant to represent the output of pre-processing the syn_nssp_line_list dataset, which is a synthetic patient-level line list data from the United State's National Syndromic Surveillance System (NSSP).syn_nssp_df
A synthetic dataset resembling line-list (each row is a patient) data from the United States' National Syndromic Surveillance System (NSSP) accessed via the Essence platform. All entries are synthetic, formatted to look as close to the real raw data as possible.syn_nssp_line_list
Get last rows of a reporting_triangletail.reporting_triangle
Truncate reporting triangle to a specific maximum delaytruncate_to_delay
Truncate reporting_triangle to quantile-based maximum delaytruncate_to_quantile
Truncate reporting triangle by removing a specified number of the last rowstruncate_to_row
Truncate reporting triangle by removing bottom rowstruncate_to_rows
Validate a reporting_triangle objectvalidate_reporting_triangle