Skip to contents

This function ingests a point nowcast matrix and a vector of dispersion parameters. It generates a list of n_draws nowcast matrices.

Usage

add_uncertainty(point_nowcast_matrix, disp, n_draws = 1000)

Arguments

point_nowcast_matrix

Matrix of both observations and point estimates of counts at each reference time and delay.

disp

Vector of dispersion parameters indexed starting at delay = 1,

n_draws

Integer indicating the number of expected observed reporting squares to generate. Default is 1000.

Value

nowcast_matrix_list List of n_draws matrices of probabilistic nowcast matrix draws.

Examples

point_nowcast_matrix <- matrix(
  c(
    80, 50, 25, 10,
    100, 50, 30, 20,
    90, 45, 25, 17.8,
    80, 40, 23.2, 15.9,
    70, 35, 20.3, 19.9
  ),
  nrow = 5,
  byrow = TRUE
)

list_of_exp_obs_nowcast <- add_uncertainty(
  point_nowcast_matrix = point_nowcast_matrix,
  disp = c(8, 1.4, 4),
  n_draws = 10
)
print(list_of_exp_obs_nowcast[[1]])
#>      [,1] [,2] [,3] [,4]
#> [1,]   80   50   25   10
#> [2,]  100   50   30   20
#> [3,]   90   45   25    8
#> [4,]   80   40   17   35
#> [5,]   70   13    3    5