Baseline Nowcasting for Right-Truncated Epidemiological Data
Allocate training volume based on combination of defaults and user-spe...
Apply the delay to generate a point nowcast
Apply reporting structure to generate a single retrospective reporting...
Apply reporting structures to generate retrospective reporting triangl...
Convert reporting_triangle to ChainLadder triangle format
Create a reporting_triangle object from a data.frame
Create a reporting_triangle from a matrix
Create a reporting_triangle object
Convert ChainLadder triangle to reporting_triangle format
Convert reporting_triangle to data.frame
Convert reporting_triangle to plain matrix
Assert validity of baselinenowcast_df objects
Validate each item in the reporting triangle
Assert validity of reporting_triangle objects
Nowcast Data.frame Object
Create a dataframe of nowcast results from a dataframe of cases indexe...
Generate a nowcast
Create a dataframe of nowcast results from a single reporting triangle
Combine observed data with a single prediction draw
Internal: Add days to dates
Internal: Add months to dates
Internal: Add weeks to dates
Internal: Add years to dates
Apply mask to extract the elements of the matrix that are both true
Assign number of reference times to delay and uncertainty from the siz...
Calculate the updated rows of the expected nowcasted triangle
Calculate the number of retrospective nowcast times that can be used a...
Helper function to calculate various size requirements
Check target size against number of reference times available and the ...
Check if there are non-zero-values on the LHS of NAs
Check if matrix has valid NA pattern
Check observations and predictions are compatible
Combine triangle data.frames
Compute complete row statistics
Compute nowcast requirement statistics
Compute quantile delay statistics for complete rows
Compute zero value statistics
Count rows with negative values
Internal: Compute day difference between dates
Internal: Compute month difference between dates
Internal: Compute week difference between dates
Internal: Compute year difference between dates
Display basic triangle information
Extract from one matrix only elements that are missing in another
Filter to recent horizons
Get formatted reference date range string
Get triangle dimension information
Helper for when target exceeds available reference times
Perform the allocation process
Rename required columns
Safe iterator
Split dataframe into a list of dataframes by the entries in the specif...
Update reporting_triangle with new matrix data
Validate triangle to nowcast and delay PMF together Various checks to ...
Validate the delay PMF if it is passed in
Validate reporting_triangle for delay estimation Domain-specific check...
Helper function to validate allocation parameters
Validate the specified number of reference times meets the minimum req...
Validate the inputs to estimate_and_apply_uncertainty() to ensure th...
Validate reporting_triangle constructor arguments
Validate the reporting triangle data.frame
Validate each of the strata columns passed to baselinenowcast
Validate the uncertainty parameters if they are passed in
Estimate and apply delay from a reporting triangle
Estimate and apply delays to generate retrospective nowcasts
Estimate and apply uncertainty to a point nowcast matrix
Estimate a delay distribution from a reporting triangle
Estimate uncertainty parameters using retrospective nowcasts
Estimate uncertainty parameters
Helper function that fits its each column of the matrix (horizon) to a...
Fit a negative binomial to a vector of observations and expectations
Compute delays between report dates and reference dates
Get delays unit from a reporting triangle
Get maximum delay from reporting_triangle
Get mean delay for each row of reporting_triangle
Get quantile delay for each row of reporting_triangle
Get reference dates from reporting_triangle
Compute report dates from reference dates and delays
Get reporting structure from a reporting triangle
Get first rows of a reporting_triangle
Check if an object is a reporting_triangle
Combine data from a nowcast dataframe, strata, and reference dates
Class constructor for reporting_triangle objects
Preprocess negative values in the reporting triangle
Print a reporting_triangle object
Reporting Triangle Object
Sample from negative binomial model given a set of predictions
Generate a single draw of a nowcast combining observed and predicted v...
Generate multiple draws of a nowcast combining observed and predicted ...
Get a draw of only the predicted elements of the nowcast vector
Get a dataframe of multiple draws of only the predicted elements of th...
Subset reporting_triangle objects
Subset assignment for reporting_triangle objects
Summarize a reporting_triangle object
Get last rows of a reporting_triangle
Truncate reporting triangle to a specific maximum delay
Truncate reporting_triangle to quantile-based maximum delay
Truncate reporting triangle by removing a specified number of the last...
Truncate reporting triangle by removing bottom rows
Validate a reporting_triangle object
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.
Useful links