Skip to contents

All functions

add_uncertainty()
Add observation errors to nowcasts
aggregate_df_by_ref_time()
Summarise a dataframe containing draws of reporting squares
apply_delay()
Apply the delay to generate a point nowcast Generate a point estimate of a completed reporting square (or rectangle) from a reporting triangle that we want to complete with a nowcast and a delay PMF. Each element is computed by taking the product of the expected number of total cases assigned to a reference time $t$ and the proportion of those cases reported on delay $d$. The formula to obtain the expected number of total cases as a function of the reporting delay and previous observations was derived elsewhere. This code was adapted from code written (under an MIT license) by the Karlsruhe Institute of Technology RESPINOW German Hospitalization Nowcasting Hub. Modified from: https://github.com/KITmetricslab/RESPINOW-Hub/blob/7cce3ae2728116e8c8cc0e4ab29074462c24650e/code/baseline/functions.R#L55 #nolint
estimate_dispersion()
Estimate dispersion parameters
generate_pt_nowcast_mat()
Generate point nowcast
generate_pt_nowcast_mat_list()
Generate retrospective nowcasts
generate_triangles()
Generate retrospective reporting triangles
get_delay_estimate()
Estimate a delay distribution from a reporting triangle Provides an estimate of the reporting delay as a function of the delay, based on the reporting triangle and the specified maximum delay and number of reference date observations to be used in the estimation. This point estimate of the delay is computed empirically, using an iterative algorithm starting from the most recent observations. This code was adapted from code written (under an MIT license) by the Karlsruhe Institute of Technology RESPINOW German Hospitalization Nowcasting Hub. Modified from: https://github.com/KITmetricslab/RESPINOW-Hub/blob/7cce3ae2728116e8c8cc0e4ab29074462c24650e/code/baseline/functions.R#L55 #nolint
get_nowcast_mat_draw()
Get a probabilistic draw from the observation model
nowcast_matrix_list_to_df()
Generate probabilistic nowcast dataframe
nowcast_matrix_to_df()
Convert a reporting square matrix to a long data frame
replace_lower_right_with_NA()
Replace the lower right triangle of the matrix with NAs
truncate_triangle()
Get a single truncated triangle
truncate_triangles()
Generate truncated reporting triangles