sbrier: Calculate the Scaled Brier Score for predicted probabilities...

View source: R/sbrier.R

sbrierR Documentation

Calculate the Scaled Brier Score for predicted probabilities against a binary outcome.

Description

Calculate the Scaled Brier Score for predicted probabilities against a binary outcome.

Usage

sbrier(preds, obs)

Arguments

preds

A vector of predicted probabilities.

obs

A vector containing the observed binary outcomes (0 or 1).

Value

The Scaled Brier Score given by

BS_{scaled} = 1 - \frac{BS}{BS_{max}}

where

BS_{max} = \frac{1}{N} \sum (y - \bar y)^2

.

Examples

# Generate some predictions
predictions <- runif(1000)
# Generate some binary outcomes
observations <- sample(0:1, size = 1000, replace = TRUE)
# Calculate the Scaled Brier Score
sbrier(predictions, observations)

gweissman/gmish documentation built on Feb. 21, 2025, 1:20 a.m.