View source: R/model-validation.R
enw_score_nowcast | R Documentation |
Acts as a wrapper to scoringutils::score()
. In particular,
handling filtering nowcast summary output and linking this output to
observed data. See the documentation for the scoringutils
package for more
on forecast scoring.
enw_score_nowcast(
nowcast,
latest_obs,
log = FALSE,
check = FALSE,
round_to = 3,
...
)
nowcast |
A posterior nowcast or posterior prediction as returned by
|
latest_obs |
A |
log |
Logical, defaults to FALSE. Should scores be calculated on the log scale (with a 0.01 shift) for both observations and nowcasts. Scoring in this way can be thought of as a relative score vs the more usual absolute measure. It may be useful when targets are on very different scales or when the forecaster is more interested in good all round performance versus good performance for targets with large values. |
check |
Logical, defaults to FALSE. Should
|
round_to |
Integer defaults to 3. Number of digits to round scoring output to. |
... |
Arguments passed on to
|
A data.table
as returned by scoringutils::score()
.
library(data.table)
library(scoringutils)
# Summarise example nowcast
nowcast <- enw_example("nowcast")
summarised_nowcast <- summary(nowcast)
# Load latest available observations
obs <- enw_example("observations")
# Keep the last 7 days of data
obs <- obs[reference_date > (max(reference_date) - 7)]
# score on the absolute scale
scores <- enw_score_nowcast(summarised_nowcast, obs)
summarise_scores(scores, by = "location")
# score overall on a log scale
log_scores <- enw_score_nowcast(summarised_nowcast, obs, log = TRUE)
summarise_scores(log_scores, by = "location")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.