Skip to contents

Generate a single draw of a nowcast combining observed and predicted values

Usage

get_nowcast_draw(point_nowcast_matrix, reporting_triangle, dispersion, ...)

Arguments

point_nowcast_matrix

Matrix of point nowcast predictions and observations, with rows representing the reference times and columns representing the delays.

reporting_triangle

Matrix of the reporting triangle, with rows representing the time points of reference and columns representing the delays. Can be a reporting matrix or incomplete reporting matrix. Can also be a ragged reporting triangle, where multiple columns are reported for the same row. (e.g. weekly reporting of daily data).

dispersion

Vector of dispersion parameters indexed by horizon from minus one to the maximum delay.

...

Additional arguments passed to get_nowcast_pred_draws()

Value

Vector of predicted counts at each reference time based on combining the observed counts and the predicted counts for the unobserved elements.

Examples

point_nowcast_matrix <- matrix(
  c(
    80, 50, 25, 10,
    100, 50, 30, 20,
    90, 45, 25, 16.8,
    80, 40, 21.2, 19.5,
    70, 34.5, 15.4, 9.1
  ),
  nrow = 5,
  byrow = TRUE
)
reporting_triangle <- generate_triangle(point_nowcast_matrix)
disp <- c(0.8, 12.4, 9.1)
nowcast_draw <- get_nowcast_draw(
  point_nowcast_matrix,
  reporting_triangle,
  disp
)
nowcast_draw
#> [1] 165 200 166 134 167