enw_summarise_samples | R Documentation |
This function summarises posterior samples for arbitrary strata. It optionally holds out the observed data (variables that are not ".draw", ".iteration", ".sample", ".chain" ) joins this to the summarised posterior.
enw_summarise_samples(
samples,
probs = c(0.05, 0.2, 0.35, 0.5, 0.65, 0.8, 0.95),
by = c("reference_date", ".group"),
link_with_obs = TRUE
)
samples |
A |
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. |
by |
A character vector of variables to summarise by. Defaults to
|
link_with_obs |
Logical, should the observed data be linked to the
posterior summary? This is useful for plotting the posterior against the
observed data. Defaults to |
A data.frame
summarising the posterior samples.
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_pp_summary()
,
enw_quantiles_to_long()
,
subset_obs()
fit <- enw_example("nowcast")
samples <- summary(fit, type = "nowcast_sample")
enw_summarise_samples(samples, probs = c(0.05, 0.5, 0.95))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.