View source: R/score.mvgam_forecast.R
score.mvgam_forecast | R Documentation |
Compute probabilistic forecast scores for mvgam objects
## S3 method for class 'mvgam_forecast'
score(
object,
score = "crps",
log = FALSE,
weights,
interval_width = 0.9,
n_cores = 1,
...
)
score(object, ...)
object |
|
score |
|
log |
|
weights |
optional |
interval_width |
proportional value on |
n_cores |
|
... |
Ignored |
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
forecast.mvgam
, ensemble
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.