This function ingests a list of point nowcast matrices and a corresponding list of truncated reporting matrices and uses both to estimate a vector of negative binomial dispersion parameters from the observations and estimates at each delay, starting at delay = 1.
Usage
estimate_dispersion(
pt_nowcast_mat_list,
trunc_rep_mat_list,
n = length(pt_nowcast_mat_list)
)
Arguments
- pt_nowcast_mat_list
List of point nowcast matrices where rows represent reference time points and columns represent delays.
- trunc_rep_mat_list
List of truncated reporting matrices, containing all observations as of the latest reference time. Elements of list are paired with elements of
pt_nowcast_mat_list
.- n
Integer indicating the number of reporting matrices to use to estimate the dispersion parameters.
Value
Vector of length one less than the number of columns in the latest reporting triangle, with each element representing the estimate of the dispersion parameter for each delay d, starting at delay d=1.
Examples
triangle <- matrix(
c(
65, 46, 21, 7,
70, 40, 20, 5,
80, 50, 10, 10,
100, 40, 31, 20,
95, 45, 21, NA,
82, 42, NA, NA,
70, NA, NA, NA
),
nrow = 7,
byrow = TRUE
)
trunc_rts <- truncate_triangles(
reporting_triangle = triangle,
n = 2
)
retro_rts <- generate_triangles(
trunc_rep_mat_list = trunc_rts
)
retro_nowcasts <- generate_pt_nowcast_mat_list(
reporting_triangle_list = retro_rts,
n = 5
)
disp_params <- estimate_dispersion(
pt_nowcast_mat_list = retro_nowcasts,
trunc_rep_mat_list = trunc_rts,
n = 2
)