| get_predictions | R Documentation |
Extracts predictions from a fitted model. For estimate_infections() returns
predicted reported cases, for estimate_secondary() returns predicted
secondary observations. For estimate_truncation() returns reconstructed
observations adjusted for truncation.
get_predictions(object, ...)
## S3 method for class 'estimate_infections'
get_predictions(
object,
format = c("summary", "sample", "quantile"),
CrIs = c(0.2, 0.5, 0.9),
quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95),
...
)
## S3 method for class 'estimate_secondary'
get_predictions(
object,
format = c("summary", "sample", "quantile"),
CrIs = c(0.2, 0.5, 0.9),
quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95),
...
)
## S3 method for class 'forecast_infections'
get_predictions(
object,
format = c("summary", "sample", "quantile"),
CrIs = c(0.2, 0.5, 0.9),
quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95),
...
)
## S3 method for class 'forecast_secondary'
get_predictions(
object,
format = c("summary", "sample", "quantile"),
CrIs = c(0.2, 0.5, 0.9),
quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95),
...
)
## S3 method for class 'estimate_truncation'
get_predictions(
object,
format = c("summary", "sample", "quantile"),
CrIs = c(0.2, 0.5, 0.9),
quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95),
...
)
object |
A fitted model object (e.g., from |
... |
Additional arguments (currently unused) |
format |
Character string specifying the output format:
|
CrIs |
Numeric vector of credible intervals to return. Defaults to
c(0.2, 0.5, 0.9). Only used when |
quantiles |
Numeric vector of quantile levels to return. Defaults to
c(0.05, 0.25, 0.5, 0.75, 0.95). Only used when |
A data.table with columns depending on format:
format = "summary": date, mean, sd, median, and credible intervals
format = "sample": forecast_date, date, horizon, sample, predicted
format = "quantile": forecast_date, date, horizon, quantile_level,
predicted
## Not run:
# After fitting a model
# Get summary predictions (default)
predictions <- get_predictions(fit)
# Get sample-level predictions for scoringutils
samples <- get_predictions(fit, format = "sample")
# Get quantile predictions for scoringutils
quantiles <- get_predictions(fit, format = "quantile")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.