fv_tidy_posterior | R Documentation |
A very opinionated wrapper around
posterior::summarise_draws()
with cleaning and tidying including linking
to observed data, tidying parameter names, and transforming parameters for
interpretability. See fv_posterior()
for a more generic solution.
fv_tidy_posterior(
fit,
probs = c(0.05, 0.2, 0.8, 0.95),
digits = 3,
voc_label = "VOC",
scale_r = 1,
timespan = 7
)
fit |
List of output as returned by |
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 (such as |
digits |
Numeric, defaults to 3. Number of digits to round summary statistics to. |
voc_label |
A character string, default to "VOC". Defines the label to assign to variant of concern specific parameters. Example usage is to rename parameters to use variant specific terminology. |
scale_r |
Numeric, defaults to 1. Rescale the timespan over which the growth rate and reproduction number is calculated. An example use case is rescaling the growth rate from weekly to be scaled by the mean of the generation time (for COVID-19 for example this would be 5.5 / 7. |
timespan |
Integer, defaults to 7. Indicates the number of days between each observation. Defaults to a week. |
A dataframe summarising the model posterior. Output is stratified
by value_type
with posterior summaries by case, voc, voc advantage vs
non-voc over time, rt, growth, model, and the raw posterior summary.
Functions used for postprocessing of model fits
convert_to_stanfit()
,
extract_draws()
,
extract_forecast_dates()
,
fv_extract_forecast()
,
fv_posterior()
,
link_dates_with_posterior()
,
link_obs_with_posterior()
,
plot.fv_posterior()
,
print.fv_posterior()
,
quantiles_to_long()
,
summary.fv_posterior()
,
update_voc_label()
options(mc.cores = 4)
obs <- filter_by_availability(
germany_covid19_delta_obs,
date = as.Date("2021-06-12"),
)
dt <- fv_as_data_list(obs)
inits <- fv_inits(dt)
fit <- fv_sample(dt, init = inits, adapt_delta = 0.99, max_treedepth = 15)
fv_tidy_posterior(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.