Skip to contents

[Stable] Extracts predictions from a fitted model, combining observations with model estimates. For estimate_infections() returns predicted reported cases, for estimate_secondary() returns predicted secondary observations.

Usage

get_predictions(object, ...)

# S3 method for class 'estimate_infections'
get_predictions(object, CrIs = c(0.2, 0.5, 0.9), ...)

# S3 method for class 'estimate_secondary'
get_predictions(object, CrIs = c(0.2, 0.5, 0.9), ...)

# S3 method for class 'forecast_infections'
get_predictions(object, ...)

# S3 method for class 'forecast_secondary'
get_predictions(object, ...)

Arguments

object

A fitted model object (e.g., from estimate_infections() or estimate_secondary())

...

Additional arguments (currently unused)

CrIs

Numeric vector of credible intervals to return. Defaults to c(0.2, 0.5, 0.9).

Value

A data.table with columns including date, observations, and summary statistics (mean, sd, credible intervals) for the model predictions.

Examples

if (FALSE) { # \dontrun{
# After fitting a model
predictions <- get_predictions(fit)
} # }