Documentation

CslibFrontier.GameTheory.PredictionMarket.ScoringRules

Proper scoring rules and the Savage characterization #

A scoring rule on a finite outcome space Ω assigns a real reward S.score p ω to a reported probability distribution p : Ω → ℝ when outcome ω : Ω realizes [FriedmanResnickSami2007, §27.4.2, pp. 686–687; GneitingRaftery2007]. Probability distributions are represented by Cslib.GameTheory.IsMixedStrategy, forming the closed simplex probSimplex Ω and its strictly positive interior openProbSimplex Ω.

A scoring rule is proper on a set P of distributions if reporting one's true belief q ∈ P maximizes expected score ∑ ω, q ω * S.score p ω over p ∈ P, and strictly proper on P if p = q is the unique maximizer [FriedmanResnickSami2007, Definition 27.1, p. 686]. Real-valued scoring rules such as the quadratic (Brier) score and spherical score are strictly proper on the entire closed simplex probSimplex Ω, while the logarithmic score ω ↦ Real.log (p ω) is strictly proper on openProbSimplex Ω (and, more generally, whenever the support of q is contained in that of p, avoiding the real-valued Real.log 0 = 0 convention at zero-probability reports).

Following [Sav71] and [GR07], every (strictly) proper scoring rule on a convex set P ⊆ probSimplex Ω is characterized by a (strictly) convex potential G : (Ω → ℝ) → ℝ together with a (strict) subgradient map g : (Ω → ℝ) → Ω → ℝ via S(p, ω) = G(p) + g(p)(ω) - p ⬝ᵥ g(p). The expected score loss of misreporting p under true belief q equals the Bregman divergence G(q) - G(p) - (q - p) ⬝ᵥ g(p). When G is Fréchet differentiable within P with gradient g(p), convexity (respectively strict convexity) of G directly implies propriety (respectively strict propriety) of savageScoringRule G g.

Main definitions #

Main results #

References #

@[reducible, inline]

The closed probability simplex over a finite outcome type Ω.

@[reducible, inline]

The open (strictly positive) probability simplex over a finite outcome type Ω.

The closed probability simplex is convex.

The open probability simplex is convex.

A real-valued scoring rule on a finite outcome space Ω, mapping a reported probability vector p : Ω → ℝ and realized outcome ω : Ω to a real score [FriedmanResnickSami2007, §27.4.2, pp. 686–687].

  • score : (Ω → ℝ) → Ω → ℝ

    The score awarded when reporting distribution p and outcome ω occurs.

theorem Cslib.GameTheory.PredictionMarket.ScoringRule.ext {Ω : Type u_2} {x y : ScoringRule Ω} (score : x.score = y.score) :
x = y

Positive affine transformation of a scoring rule: b * S(p, ω) + h(ω).

@[simp]
theorem Cslib.GameTheory.PredictionMarket.ScoringRule.affine_score {Ω : Type u_1} (S : ScoringRule Ω) (b : ℝ) (h p : Ω → ℝ) (ω : Ω) :
(S.affine b h).score p ω = b * S.score p ω + h ω

The expected score under true belief distribution q when reporting distribution p.

@[simp]
theorem Cslib.GameTheory.PredictionMarket.ScoringRule.expectedScore_apply {Ω : Type u_1} [Fintype Ω] (S : ScoringRule Ω) (q p : Ω → ℝ) :
S.expectedScore q p = ∑ ω : Ω, q ω * S.score p ω
theorem Cslib.GameTheory.PredictionMarket.ScoringRule.expectedScore_congr {Ω : Type u_1} [Fintype Ω] {S₁ S₂ : ScoringRule Ω} {p : Ω → ℝ} (h : ∀ (ω : Ω), S₁.score p ω = S₂.score p ω) (q : Ω → ℝ) :
S₁.expectedScore q p = S₂.expectedScore q p

Two scoring rules that agree at report p across all outcomes have equal expected scores at report p under every belief q.

A scoring rule is proper on a set P of distributions if reporting one's true belief q ∈ P maximizes expected score among all reports p ∈ P.

A scoring rule is strictly proper on a set P of distributions if reporting one's true belief q ∈ P is the unique maximizer of expected score among all reports p ∈ P [FriedmanResnickSami2007, Definition 27.1, p. 686].

@[reducible, inline]

A scoring rule is proper if it is proper on the full probability simplex probSimplex Ω.

@[reducible, inline]

A scoring rule is strictly proper if it is strictly proper on the full probability simplex probSimplex Ω.

theorem Cslib.GameTheory.PredictionMarket.ScoringRule.isProperOn_iff {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} :
S.IsProperOn P ↔ ∀ q ∈ P, ∀ p ∈ P, S.expectedScore q p ≤ S.expectedScore q q
theorem Cslib.GameTheory.PredictionMarket.ScoringRule.isStrictlyProperOn_iff {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} :
S.IsStrictlyProperOn P ↔ ∀ q ∈ P, ∀ p ∈ P, p ≠ q → S.expectedScore q p < S.expectedScore q q
theorem Cslib.GameTheory.PredictionMarket.ScoringRule.IsProperOn.expectedScore_le {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} (h : S.IsProperOn P) {q p : Ω → ℝ} (hq : q ∈ P) (hp : p ∈ P) :
theorem Cslib.GameTheory.PredictionMarket.ScoringRule.IsStrictlyProperOn.expectedScore_lt {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} (h : S.IsStrictlyProperOn P) {q p : Ω → ℝ} (hq : q ∈ P) (hp : p ∈ P) (hpq : p ≠ q) :

Strict propriety implies propriety on the same domain.

theorem Cslib.GameTheory.PredictionMarket.ScoringRule.IsProperOn.mono {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P Q : Set (Ω → ℝ)} (h : S.IsProperOn P) (hQP : Q ⊆ P) :

Propriety is preserved under restricting the domain of distributions.

Strict propriety is preserved under restricting the domain of distributions.

theorem Cslib.GameTheory.PredictionMarket.ScoringRule.IsProperOn.affine {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} (hS : S.IsProperOn P) {b : ℝ} (hb : 0 ≤ b) (h : Ω → ℝ) :
(S.affine b h).IsProperOn P

Nonnegative affine rescaling preserves propriety.

theorem Cslib.GameTheory.PredictionMarket.ScoringRule.IsStrictlyProperOn.affine {Ω : Type u_1} [Fintype Ω] {S : ScoringRule Ω} {P : Set (Ω → ℝ)} (hS : S.IsStrictlyProperOn P) {b : ℝ} (hb : 0 < b) (h : Ω → ℝ) :

Positive affine rescaling preserves strict propriety.

def Cslib.GameTheory.PredictionMarket.dotCLM {Ω : Type u_1} [Fintype Ω] (g : Ω → ℝ) :
(Ω → ℝ) →L[ℝ] ℝ

The continuous linear functional v ↦ v ⬝ᵥ g on Ω → ℝ.

@[simp]
theorem Cslib.GameTheory.PredictionMarket.dotCLM_apply {Ω : Type u_1} [Fintype Ω] (g v : Ω → ℝ) :
(dotCLM g) v = v ⬝ᵥ g
def Cslib.GameTheory.PredictionMarket.savageScoringRule {Ω : Type u_1} [Fintype Ω] (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ) :

The Savage scoring rule generated by a potential G : (Ω → ℝ) → ℝ and vector field g : (Ω → ℝ) → Ω → ℝ: S(p, ω) = G(p) + g(p)(ω) - p ⬝ᵥ g(p) = G(p) + (e_ω - p) ⬝ᵥ g(p) [Savage1971; GneitingRaftery2007].

@[simp]
theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_score {Ω : Type u_1} [Fintype Ω] (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ) (p : Ω → ℝ) (ω : Ω) :
(savageScoringRule G g).score p ω = G p + g p ω - p ⬝ᵥ g p
theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_score_eq_single {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ) (p : Ω → ℝ) (ω : Ω) :
(savageScoringRule G g).score p ω = G p + (Pi.single ω 1 - p) ⬝ᵥ g p
def Cslib.GameTheory.PredictionMarket.bregmanDivergence {Ω : Type u_1} [Fintype Ω] (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ) (q p : Ω → ℝ) :

The Bregman divergence associated with a potential G : (Ω → ℝ) → ℝ and subgradient map g : (Ω → ℝ) → Ω → ℝ: D_{G, g}(q ‖ p) = G(q) - G(p) - (q - p) ⬝ᵥ g(p).

@[simp]
theorem Cslib.GameTheory.PredictionMarket.bregmanDivergence_apply {Ω : Type u_1} [Fintype Ω] (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ) (q p : Ω → ℝ) :
bregmanDivergence G g q p = G q - G p - (q - p) ⬝ᵥ g p
theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_expectedScore {Ω : Type u_1} [Fintype Ω] {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} {q p : Ω → ℝ} (hq : ∑ ω : Ω, q ω = 1) :
(savageScoringRule G g).expectedScore q p = G p + (q - p) ⬝ᵥ g p

Expected score of savageScoringRule G g under any vector q summing to 1.

theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_expectedScore_self {Ω : Type u_1} [Fintype Ω] {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} {q : Ω → ℝ} (hq : ∑ ω : Ω, q ω = 1) :
theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_score_gap_eq_bregmanDivergence {Ω : Type u_1} [Fintype Ω] {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} {q p : Ω → ℝ} (hq : ∑ ω : Ω, q ω = 1) :

The expected score gap of savageScoringRule G g between truthfully reporting q and reporting p equals the Bregman divergence bregmanDivergence G g q p [GR07].

theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_isProperOn_iff {Ω : Type u_1} [Fintype Ω] {P : Set (Ω → ℝ)} (hP : P ⊆ probSimplex Ω) {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} :
(savageScoringRule G g).IsProperOn P ↔ ∀ p ∈ P, ∀ q ∈ P, G p + (q - p) ⬝ᵥ g p ≤ G q

savageScoringRule G g is proper on P ⊆ probSimplex Ω iff g is a subgradient of G on P (equivalently, bregmanDivergence G g is nonnegative on P).

theorem Cslib.GameTheory.PredictionMarket.savageScoringRule_isStrictlyProperOn_iff {Ω : Type u_1} [Fintype Ω] {P : Set (Ω → ℝ)} (hP : P ⊆ probSimplex Ω) {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} :
(savageScoringRule G g).IsStrictlyProperOn P ↔ ∀ p ∈ P, ∀ q ∈ P, q ≠ p → G p + (q - p) ⬝ᵥ g p < G q

savageScoringRule G g is strictly proper on P ⊆ probSimplex Ω iff g is a strict subgradient of G on P.

theorem Cslib.GameTheory.PredictionMarket.isProperOn_savageScoringRule_of_convexOn {Ω : Type u_1} [Fintype Ω] {P : Set (Ω → ℝ)} (hP : P ⊆ probSimplex Ω) {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} (hG : ConvexOn ℝ P G) (hd : ∀ p ∈ P, HasFDerivWithinAt G (dotCLM (g p)) P p) :

Differentiable sufficient condition for propriety: if G is convex on P ⊆ probSimplex Ω and has Fréchet derivative dotCLM (g p) within P at every p ∈ P, then savageScoringRule G g is proper on P [Savage1971; GneitingRaftery2007].

theorem Cslib.GameTheory.PredictionMarket.isStrictlyProperOn_savageScoringRule_of_strictConvexOn {Ω : Type u_1} [Fintype Ω] {P : Set (Ω → ℝ)} (hP : P ⊆ probSimplex Ω) {G : (Ω → ℝ) → ℝ} {g : (Ω → ℝ) → Ω → ℝ} (hG : StrictConvexOn ℝ P G) (hd : ∀ p ∈ P, HasFDerivWithinAt G (dotCLM (g p)) P p) :

Differentiable sufficient condition for strict propriety: if G is strictly convex on P ⊆ probSimplex Ω and has Fréchet derivative dotCLM (g p) within P at every p ∈ P, then savageScoringRule G g is strictly proper on P [Savage1971; GneitingRaftery2007].

theorem Cslib.GameTheory.PredictionMarket.isProperOn_iff_exists_savage {Ω : Type u_1} [Fintype Ω] {P : Set (Ω → ℝ)} (hP : P ⊆ probSimplex Ω) (hPconv : Convex ℝ P) (S : ScoringRule Ω) :
S.IsProperOn P ↔ ∃ (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ), ConvexOn ℝ P G ∧ (∀ p ∈ P, ∀ q ∈ P, G p + (q - p) ⬝ᵥ g p ≤ G q) ∧ ∀ p ∈ P, ∀ (ω : Ω), S.score p ω = (savageScoringRule G g).score p ω

Savage / Gneiting–Raftery characterization of proper scoring rules [Savage1971; GneitingRaftery2007]: on a convex subset P ⊆ probSimplex Ω, a scoring rule S is proper on P if and only if there exist a convex potential G on P and a subgradient map g on P such that S.score p ω = (savageScoringRule G g).score p ω for all p ∈ P and ω : Ω.

theorem Cslib.GameTheory.PredictionMarket.isStrictlyProperOn_iff_exists_savage {Ω : Type u_1} [Fintype Ω] {P : Set (Ω → ℝ)} (hP : P ⊆ probSimplex Ω) (hPconv : Convex ℝ P) (S : ScoringRule Ω) :
S.IsStrictlyProperOn P ↔ ∃ (G : (Ω → ℝ) → ℝ) (g : (Ω → ℝ) → Ω → ℝ), StrictConvexOn ℝ P G ∧ (∀ p ∈ P, ∀ q ∈ P, q ≠ p → G p + (q - p) ⬝ᵥ g p < G q) ∧ ∀ p ∈ P, ∀ (ω : Ω), S.score p ω = (savageScoringRule G g).score p ω

Savage / Gneiting–Raftery characterization of strictly proper scoring rules [Savage1971; GneitingRaftery2007]: on a convex subset P ⊆ probSimplex Ω, a scoring rule S is strictly proper on P if and only if there exist a strictly convex potential G on P and a strict subgradient map g on P such that S.score p ω = (savageScoringRule G g).score p ω for all p ∈ P and ω : Ω.

Quadratic (Brier) scoring rule #

The quadratic scoring rule: S(p, ω) = 2 * p ω - ∑ ω', p ω' ^ 2 [FriedmanResnickSami2007, §27.4.2, pp. 686–687, Exercise 27.7, p. 697; GneitingRaftery2007].

@[simp]
theorem Cslib.GameTheory.PredictionMarket.quadraticScore_score {Ω : Type u_1} [Fintype Ω] (p : Ω → ℝ) (ω : Ω) :
(quadraticScore Ω).score p ω = 2 * p ω - ∑ ω' : Ω, p ω' ^ 2
theorem Cslib.GameTheory.PredictionMarket.quadraticScore_eq_savage {Ω : Type u_1} [Fintype Ω] :
quadraticScore Ω = savageScoringRule (fun (p : Ω → ℝ) => ∑ ω : Ω, p ω ^ 2) fun (p : Ω → ℝ) (ω : Ω) => 2 * p ω

The quadratic scoring rule is the Savage scoring rule generated by G(p) = ∑ ω, p ω ^ 2 and g(p)(ω) = 2 * p ω.

theorem Cslib.GameTheory.PredictionMarket.quadraticScore_expectedScore_sub {Ω : Type u_1} [Fintype Ω] {q p : Ω → ℝ} (hq : ∑ ω : Ω, q ω = 1) :
(quadraticScore Ω).expectedScore q q - (quadraticScore Ω).expectedScore q p = ∑ ω : Ω, (q ω - p ω) ^ 2

The expected score gap of quadraticScore equals the squared Euclidean distance ∑ ω, (q ω - p ω) ^ 2.

Strict propriety of the quadratic scoring rule on the full probability simplex [FriedmanResnickSami2007, §27.4.2, pp. 686–687, Exercise 27.7, p. 697; GneitingRaftery2007].

theorem Cslib.GameTheory.PredictionMarket.quadraticScore_bounds {Ω : Type u_1} [Fintype Ω] {p : Ω → ℝ} (hp : IsMixedStrategy p) (ω : Ω) :

Sharp range bounds for the quadratic scoring rule on probSimplex Ω: every score lies in [-1, 1] (giving [a - b, a + b] for the affine version a + b * quadraticScore, b > 0, as in [FriedmanResnickSami2007, Exercise 27.7, p. 697]).

The Brier scoring rule [Bri50]: S(p, ω) = -∑ ω', (1_{ω' = ω} - p ω') ^ 2.

@[simp]
theorem Cslib.GameTheory.PredictionMarket.brierScore_score {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (p : Ω → ℝ) (ω : Ω) :
(brierScore Ω).score p ω = -∑ ω' : Ω, ((if ω' = ω then 1 else 0) - p ω') ^ 2

The Brier score equals quadraticScore - 1 identically on all vectors p.

Strict propriety of the Brier scoring rule on the full probability simplex [Bri50].

Logarithmic scoring rule #

The logarithmic scoring rule: S(p, ω) = Real.log (p ω) [FriedmanResnickSami2007, §27.4.2, pp. 686–687; GneitingRaftery2007].

@[simp]
theorem Cslib.GameTheory.PredictionMarket.logScore_score {Ω : Type u_1} (p : Ω → ℝ) (ω : Ω) :
(logScore Ω).score p ω = Real.log (p ω)
theorem Cslib.GameTheory.PredictionMarket.logScore_eq_savage {Ω : Type u_1} [Fintype Ω] {p : Ω → ℝ} (hp : ∑ ω : Ω, p ω = 1) (ω : Ω) :
(logScore Ω).score p ω = (savageScoringRule (fun (r : Ω → ℝ) => ∑ i : Ω, r i * Real.log (r i)) fun (r : Ω → ℝ) (i : Ω) => Real.log (r i) + 1).score p ω

On vectors summing to 1, the logarithmic scoring rule agrees with the Savage scoring rule generated by negative Shannon entropy G(p) = ∑ ω, p ω * log (p ω) and g(p)(ω) = log (p ω) + 1.

theorem Cslib.GameTheory.PredictionMarket.logScore_expectedScore_lt {Ω : Type u_1} [Fintype Ω] {q p : Ω → ℝ} (hq : IsMixedStrategy q) (hp : IsMixedStrategy p) (hsupp : ∀ (ω : Ω), 0 < q ω → 0 < p ω) (hpq : p ≠ q) :

Strict Gibbs / KL-divergence inequality for the logarithmic scoring rule: for any q, p ∈ probSimplex Ω with p ≠ q and ∀ ω, 0 < q ω → 0 < p ω, truthfully reporting q achieves strictly higher expected log-score than reporting p.

Strict propriety of the logarithmic scoring rule on the open probability simplex openProbSimplex Ω [FriedmanResnickSami2007, §27.4.2, pp. 686–687; GneitingRaftery2007].

Spherical scoring rule #

The spherical scoring rule: S(p, ω) = p ω / √(∑ ω', p ω' ^ 2) [GR07].

@[simp]
theorem Cslib.GameTheory.PredictionMarket.sphericalScore_score {Ω : Type u_1} [Fintype Ω] (p : Ω → ℝ) (ω : Ω) :
(sphericalScore Ω).score p ω = p ω / √(∑ ω' : Ω, p ω' ^ 2)
theorem Cslib.GameTheory.PredictionMarket.sphericalScore_eq_savage {Ω : Type u_1} [Fintype Ω] {p : Ω → ℝ} (hp : IsMixedStrategy p) (ω : Ω) :
(sphericalScore Ω).score p ω = (savageScoringRule (fun (r : Ω → ℝ) => √(∑ i : Ω, r i ^ 2)) fun (r : Ω → ℝ) (i : Ω) => r i / √(∑ j : Ω, r j ^ 2)).score p ω

On probSimplex Ω, the spherical scoring rule agrees with the Savage scoring rule generated by the Euclidean norm G(p) = √(∑ ω, p ω ^ 2) and g(p)(ω) = p ω / √(∑ ω', p ω' ^ 2).

theorem Cslib.GameTheory.PredictionMarket.sphericalScore_expectedScore_self {Ω : Type u_1} [Fintype Ω] {q : Ω → ℝ} (hq : IsMixedStrategy q) :
(sphericalScore Ω).expectedScore q q = √(∑ ω : Ω, q ω ^ 2)

Truthful expected spherical score on probSimplex Ω equals the Euclidean norm √(∑ ω, q ω ^ 2).

Strict propriety of the spherical scoring rule on the full probability simplex [GR07].