score.mvgam_forecast {mvgam} | R Documentation |
Compute probabilistic forecast scores for mvgam objects
Description
Compute probabilistic forecast scores for mvgam objects
Usage
## S3 method for class 'mvgam_forecast'
score(
object,
score = "crps",
log = FALSE,
weights,
interval_width = 0.9,
n_cores = 1,
...
)
score(object, ...)
Arguments
object |
|
score |
|
log |
|
weights |
optional |
interval_width |
proportional value on |
n_cores |
|
... |
Ignored |
Value
a list
containing scores and interval coverages per forecast horizon.
If score %in% c('drps', 'crps', 'elpd')
,
the list will also contain return the sum of all series-level scores per horizon. If
score %in% c('energy','variogram')
, no series-level scores are computed and the only score returned
will be for all series. For all scores apart from elpd
, the in_interval
column in each series-level
slot is a binary indicator of whether or not the true value was within the forecast's corresponding
posterior empirical quantiles. Intervals are not calculated when using elpd
because forecasts
will only contain the linear predictors
See Also
Examples
# Simulate observations for three count-valued time series
data <- sim_mvgam()
# Fit a dynamic model using 'newdata' to automatically produce forecasts
mod <- mvgam(y ~ 1,
trend_model = RW(),
data = data$data_train,
newdata = data$data_test,
chains = 2)
# Extract forecasts into a 'mvgam_forecast' object
fc <- forecast(mod)
# Compute Discrete Rank Probability Scores and 0.90 interval coverages
fc_scores <- score(fc, score = 'drps')
str(fc_scores)