Learn R Programming

LogRegEquiv (version 0.1.5)

brier_score: brier_score function

Description

This function takes a observations vector \(y\) and matching predictions vector \(\pi\). It returns the Brier score for the predictions. Unless specified otherwise, input containing NAs will result with an NA.

Usage

brier_score(y, pi, na.rm = FALSE)

Arguments

y

the obsrevations vector

pi

the predictions vector

na.rm

ignore NA? (optional)

Value

The Brier score \(\frac{1}{N}\sum_{i=1}^{N}{(y_i-\pi_i)^2}\)

Examples

Run this code
# NOT RUN {
brier_score(rbinom(10,1,seq(0.1, 1, 0.1)), seq(0.1, 1, 0.1))
# }

Run the code above in your browser using DataLab