# Differences

This shows you the differences between the selected revision and the current version of the page.

Line 3: Line 3:
Gary Weissman posted an excellent illustration of how we may calculate the maximum Brier score, which we need for [[https://gweissman.github.io/post/evaluating-the-equivalence-of-different-formulations-of-the-scaled-brier-score/|the scaled Brier score]]. Three approaches were found to be equivalent, while the intuition for the maximum score may be best for the first formulation, as discussed at [[https://twitter.com/garyweissman/status/1121100599918039040||Twitter]]. Gary Weissman posted an excellent illustration of how we may calculate the maximum Brier score, which we need for [[https://gweissman.github.io/post/evaluating-the-equivalence-of-different-formulations-of-the-scaled-brier-score/|the scaled Brier score]]. Three approaches were found to be equivalent, while the intuition for the maximum score may be best for the first formulation, as discussed at [[https://twitter.com/garyweissman/status/1121100599918039040||Twitter]].
-===== Code for scaled Brier score calculation =====+==== Code for scaled Brier score calculation ====
<code> <code>
+brier_score <- function(obs, pred) { mean((obs - pred)^2) } # obs: 0/1 outcome y; pred: predicted probability p̂
scaled_brier_score_1 <- function(obs, pred) { scaled_brier_score_1 <- function(obs, pred) {
-  1 - (brier_score(obs, pred) / brier_score(obs, mean(obs))) }+  1 - (brier_score(obs, pred) / brier_score(obs, mean(obs))) } # mean(obs): ȳ
scaled_brier_score_2 <- function(obs, pred) { scaled_brier_score_2 <- function(obs, pred) {
1 - (brier_score(obs, pred) / (mean(obs) * (1 - mean(obs)))) }   1 - (brier_score(obs, pred) / (mean(obs) * (1 - mean(obs)))) }
Line 14: Line 15:
+\\
===== Illustration of the Hosmer-Lemeshow goodness of fit test ===== ===== Illustration of the Hosmer-Lemeshow goodness of fit test ===== 