brier_score: Brier Score

View source: R/brier_score.R

brier_scoreR Documentation

Brier Score

Description

Computes the Brier Score for probabilistic forecasts of binary outcomes.

Usage

brier_score(true_values, predictions)

Arguments

true_values

A vector with the true observed values of size n with all values equal to either 0 or 1

predictions

A vector with a predicted probability that true_value = 1.

Details

The Brier score is a proper score rule that assesses the accuracy of probabilistic binary predictions. The outcomes can be either 0 or 1, the predictions must be a probability that the true outcome will be 1.

The Brier Score is then computed as the mean squared error between the probabilistic prediction and the true outcome.

Brier_Score = 1/N sum_{t = 1}^{n} (prediction_t - outcome_t)²

Value

A numeric value with the Brier Score, i.e. the mean squared error of the given probability forecasts

Examples

true_values <- sample(c(0, 1), size = 30, replace = TRUE)
predictions <- runif(n = 30, min = 0, max = 1)

brier_score(true_values, predictions)

scoringutils documentation built on Feb. 16, 2023, 7:30 p.m.