# Use example data
reporting_triangle <- apply_reporting_structure(example_reporting_triangle)
pred_counts <- c(10, 20, 30, 40)
combine_obs_with_pred(pred_counts, reporting_triangle)
# Example with rolling sum
if (requireNamespace("zoo", quietly = TRUE)) {
combine_obs_with_pred(pred_counts,
reporting_triangle,
ref_time_aggregator = function(x) zoo::rollsum(x, k = 2, align = "right")
)
}
Run the code above in your browser using DataLab