enw_nowcast_samples | R Documentation |
A generic wrapper around posterior::draws_df()
with
opinionated defaults to extract the posterior samples for the
nowcast ("pp_inf_obs"
from the stan
code). The functionality of
this function can be used directly on the output of epinowcast()
using
the supplied summary.epinowcast()
method.
enw_nowcast_samples(fit, obs, max_delay = NULL, timestep = "day")
fit |
A |
obs |
An observation |
max_delay |
Maximum delay to which nowcasts should be summarised. Must be equal (default) or larger than the modelled maximum delay. If it is larger, then nowcasts for unmodelled dates are added by assuming that case counts beyond the modelled maximum delay are fully observed. |
timestep |
The timestep to used. This can be a string ("day", "week", "month") or a numeric whole number representing the number of days. |
A data.frame
of posterior samples for the nowcast prediction.
This uses observed data where available and the posterior prediction
where not.
Functions used for postprocessing of model fits
build_ord_obs()
,
enw_add_latest_obs_to_nowcast()
,
enw_nowcast_summary()
,
enw_posterior()
,
enw_pp_summary()
,
enw_quantiles_to_long()
,
enw_summarise_samples()
,
subset_obs()
fit <- enw_example("nowcast")
enw_nowcast_samples(
fit$fit[[1]],
fit$latest[[1]],
fit$max_delay,
"day"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.