
Build an ensemble from a reporting triangle with no nowcast
Source:R/v4_nowcast_passthrough.R
nowcast_passthrough_v4.RdReturns the counts reported so far as an ensemble with one draw. Use it for an indicator that SHOULD NOT be nowcast.
Details
The method is that of nowcast_passthrough_to_ensemble_v1(), and the draws
are identical. The draw matrix has the name of value_col, with no suffix.
It holds the observed total, which includes the reports at delay
max_delay_days or later. The function draws no random numbers.
Examples
monday <- as.Date("2023-01-02") + 7 * rep(0:39, each = 3)
set.seed(1)
d <- data.table::data.table(
isoyearweek_reference = format(monday, "%G-%V"),
reporting_date = monday + rep(c(3, 10, 17), 40),
numerator = rpois(120, c(30, 15, 5)),
indicator_tag = "x", location_code = "nation", age = "total", sex = "total"
)
d <- d[reporting_date <= as.Date("2023-01-02") + 7 * 39 + 6]
tri <- csfmt_reporting_triangle_v4(
d,
id_cols = c("indicator_tag", "location_code", "age", "sex")
)
nowcast_passthrough_v4(tri, max_delay_days = 21)