summary.fv_posterior: Summary method for fv_tidy_posterior

View source: R/posterior-methods.R

summary.fv_posteriorR Documentation

Summary method for fv_tidy_posterior

Description

summary method for class "fv_tidy_posterior". Can be used to filter the posterior for variables of interest, to return forecasts only, and to summarise using the data.table method

Usage

## S3 method for class 'fv_posterior'
summary(object, type = "model", forecast = FALSE, as_dt = FALSE, ...)

Arguments

object

An object of the class fv_posterior as returned by fv_tidy_posterior() .

type

A character string used to filter the summarised output and defaulting to "model". Current options are: "model" which returns a summary of key model parameters, "cases" which returns summarised cases, "voc_frac" which returns summarised estimates of the fraction of cases that have the variant of concern, "voc_advantage" that returns summarised estimates of the the transmission advantage of the variant of concern, "growth" which returns summarised variant specific and overall growth rates, "rt" which returns summarised variant specific and overall reproduction number estimates, "raw" which returns a raw posterior summary, and "all" which returns all tidied posterior estimates.

forecast

Logical defaults to FALSE. Should fv_extract_forecast() be used to return only forecasts rather than complete posterior.

as_dt

Logical defaults to FALSE. Once any filtering has been applied should summary() fall back to using the default data.table method.

...

Additional summary arguments.

Value

A summary data.table table unless type "all" is used in which case the output is still of type "fv_posterior".

See Also

fv_tidy_posterior

Functions used for postprocessing of model fits convert_to_stanfit(), extract_draws(), extract_forecast_dates(), fv_extract_forecast(), fv_posterior(), fv_tidy_posterior(), link_dates_with_posterior(), link_obs_with_posterior(), plot.fv_posterior(), print.fv_posterior(), quantiles_to_long(), update_voc_label()

Examples

posterior <- fv_example(strains = 2, type = "posterior")

# case summary
summary(posterior, type = "cases")

# summary of the case summary
summary(posterior, type = "cases", as_dt = TRUE)

# case forecast only
summary(posterior, type = "cases", forecast = TRUE)

# voc fraction summary
summary(posterior, type = "voc_frac")

# voc advantage summary
summary(posterior, type = "voc_advantage")

# growth summary
summary(posterior, type = "growth")

# Rt summary
summary(posterior, type = "rt")

# model parameter summary
summary(posterior, type = "model")

# raw posterior values
summary(posterior, type = "raw")

epiforecasts/forecast.vocs documentation built on May 14, 2023, 2 p.m.