Week 11 · Calibration and prediction uncertainty

Distinguish a calibrated forecast from a narrow interval for a mean.

← Week 10 · Subject contents · Week 12 →

Distinguish a calibrated forecast from a narrow interval for a mean.

Work through the problem

For ten cases scored at 0.8, six positives give observed frequency 0.6. The bin discrepancy is −0.2. The Brier score averages (p−y)², so these outcomes give [6×0.04+4×0.64]/10 = 0.28. Ten cases give noisy evidence about systematic miscalibration.

An interval for E[Y|X=x] describes uncertainty in the average response. A prediction interval for the next Y also includes individual outcome variation. Under a normal model with known σ, the two standard errors in the intercept-only example are σ/√n and σ√(1+1/n).

Run the Python lab

import numpy as np
y = np.array([1]*6+[0]*4)
score = np.mean((.8-y)**2)
print("Forecast, observed, Brier:", .8,y.mean(),round(score,2))
n, sigma = 25, 2
print("Mean and new-outcome 95% half-widths:", np.round(1.96*sigma*np.array([1/np.sqrt(n),np.sqrt(1+1/n)]),2))
assert abs(score-.28)<1e-12

Output from the lab

Forecast, observed, Brier: 0.8 0.6 0.28
Mean and new-outcome 95% half-widths: [0.78 4.  ]

Practice

  1. Does perfect calibration imply a useful ranking?

Check your reasoning

  1. A constant score equal to prevalence can be calibrated and rank nobody.

← Week 10 · Subject contents · Week 12 →

Further reading · An Introduction to Statistical Learning