Skip to contents

Formula: BS = (1/T) sum_i sum_c (pihat_ic - d_ic)^2, d_ic = 1 iff y_i = c

Usage

Brierscore(P, y)

Arguments

P

Predicted category probabilities, one row per observation.

y

Observed category index, 1-based, length T.

Value

List with brier, brier_scaled, n, C.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 4, Eq. (4.14) p. 136. The book notes the categorical Brier score ranges over [0, 2] and suggests reporting BS/2; brier_scaled is that halved value. Read from the chapter PDF, not recalled.

Examples

set.seed(1)
P <- matrix(runif(30), 10, 3)
P <- P / rowSums(P)
y <- sample(1:3, 10, replace = TRUE)
Brierscore(P, y)
#> $brier
#> [1] 0.8455578
#> 
#> $brier_scaled
#> [1] 0.4227789
#> 
#> $n
#> [1] 10
#> 
#> $C
#> [1] 3
#> 
#> $method
#> [1] "Brier score, MVSML Eq. (4.14)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"