bs: Brier Score

View source: R/bs.R

bsR Documentation

Brier Score

Description

This function calculates the Brier Score (BS) given observations of an univariate variable, thresholds and corresponding PIT values of a predictive distribution.

Usage

bs(y, t, u, na.action = na.omit, aggregate = FALSE, ...)

Arguments

y

vector of observations

t

vector of threshold values (depending on y; see details)

u

vector of PIT values in [0,1] (depending on t; see details)

na.action

function to handle the NA's. Default: na.omit.

aggregate

logical or function for aggregating the single scores, e.g. sum, mean, weighted.mean, .... Default: FALSE, i.e. no aggregation function.

...

further arguments passed to the aggregate function.

Details

For a vector y of length n, the i-th entry of y belongs to the i-th entry of u and t. For given thresholds t the PIT values are obtained by u=F(t) for a predictive distribution F.

A lower BS indicates a better forecast.

Value

Vector of score value(s).

Author(s)

David Jobst

References

Brier, G. (1950). Verification of forecasts expressed in terms of probability. Monthly Weather Review, 78, 1-3.

Examples

# simulated data
n <- 30
y <- rnorm(n)
t <- sample(-10:35, size = n, replace = TRUE)
u <- pnorm(t)

# bs calculation
bs(y = y, t = t, u = u)
bs(y = y, t = t, u = u, aggregate = mean)


jobstdavid/eppverification documentation built on May 13, 2024, 5:20 p.m.