bscore | R Documentation |
Computes the Brier score of forecast probabilities for exceeding given thresholds.
bscore(predictions, thresholds, y)
predictions |
either an object of class |
thresholds |
numeric vector of thresholds at which the CDF will be evaluated. |
y |
a numeric vector of obervations of the same length as the number of
predictions, or of length 1. In the latter case, |
The Brier score for the event of exceeding a given threshold z is defined as
(1\{y > z\} - P(y > z))^2
where y is the
observation and P(y > z) the forecast probability for exceeding the
threshold z
.
A matrix of the Brier scores for the desired thresholds, one column per threshold.
Gneiting, T. and Raftery, A. E. (2007), 'Strictly proper scoring rules, prediction, and estimation', Journal of the American Statistical Association 102(477), 359-378
predict.idrfit
, cdf
data("rain")
## Postprocess HRES forecast using data of 3 years
X <- rain[1:(3 * 365), "HRES", drop = FALSE]
y <- rain[1:(3 * 365), "obs"]
fit <- idr(y = y, X = X)
## Compute Brier score for postprocessed probability of precipitation
## forecast using data of the next 2 years (out-of-sample predictions)
data <- rain[(3 * 365 + 1):(5 * 365), "HRES", drop = FALSE]
obs <- rain[(3 * 365 + 1):(5 * 365), "obs"]
predictions <- predict(fit, data = data)
score <- bscore(predictions, thresholds = 0, y = obs)
mean(score)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.