enw_pp_summary: Posterior predictive summary

enw_pp_summaryR Documentation

Posterior predictive summary

Description

This function summarises posterior predictives for observed data (by report and reference date). The functionality of this function can be used directly on the output of epinowcast() using the supplied summary.epinowcast() method.

Usage

enw_pp_summary(fit, diff_obs, probs = c(0.05, 0.2, 0.35, 0.5, 0.65, 0.8, 0.95))

Arguments

fit

A cmdstanr fit object.

diff_obs

A data.frame of observed data with at least a date variable reference_date, and a grouping variable .group.

probs

A vector of numeric probabilities to produce quantile summaries for. By default these are the 5%, 20%, 80%, and 95% quantiles which are also the minimum set required for plotting functions to work.

Value

A data.table summarising the posterior predictions.

See Also

Functions used for postprocessing of model fits build_ord_obs(), enw_add_latest_obs_to_nowcast(), enw_nowcast_samples(), enw_nowcast_summary(), enw_posterior(), enw_quantiles_to_long(), enw_summarise_samples(), subset_obs()

Examples

fit <- enw_example("nowcast")
enw_pp_summary(fit$fit[[1]], fit$new_confirm[[1]], probs = c(0.5))

seabbs/epinowcast documentation built on Sept. 20, 2024, 2:39 a.m.