bscore: Brier score for forecast probability of threshold exceedance

Description Usage Arguments Details Value References See Also Examples

View source: R/evaluation.R

Description

Computes the Brier score of forecast probabilities for exceeding given thresholds.

Usage

1
bscore(predictions, thresholds, y)

Arguments

predictions

either an object of class idr (output of predict.idrfit), or a data.frame of numeric variables. In the latter case, the CDF is computed using the empirical distribution of the variables in predictions.

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, y will be used for all predictions.

Details

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.

Value

A matrix of the Brier scores for the desired thresholds, one column per threshold.

References

Gneiting, T. and Raftery, A. E. (2007), 'Strictly proper scoring rules, prediction, and estimation', Journal of the American Statistical Association 102(477), 359-378

See Also

predict.idrfit, cdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

isodistrreg documentation built on March 22, 2021, 5:06 p.m.