Calibration
A plain-language tutorial: what it means for a stated probability to be honest, how to check when events are common, and the ladder of remedies when they are rare.
The main perspective of this article is to ask one question seven times under progressively worse conditions: how sure can you be that a stated probability is honest? Conditions are as follows:
- with plenty of data (§ 02)
- with almost none (§ 03)
- with clever workarounds (§ 04)
- changing the game entirely (§ 05)
- per population group (§ 06)
- after a failed audit (§ 07)
- when the event has essentially never happened (§ 08)
Then § 09 shows what the question cannot see even when answered perfectly.
The Definition.
Calibration is a statement about a forecaster's whole track record, sorted into buckets, never about a single forecast.
Starting with the everyday version. Let’s say you have a weather forecaster that says “30% chance of rain” for a particular day. To check calibration of this forecaster in this situation, you collect each historical 30% forecast and check: did it rain on about 30% of them? Do the same for the 80%-days, the 5%-days, the x%-days (usually with a buffer around x). If every group checks out, the forecaster’s probabilities mean what they say, and it is considered calibrated.
A forecaster is calibrated if, conditional on it assigning probability p to an outcome, the outcome occurs with frequency p, for every p it uses [1]. Writing Y = 1 when the event occurs and for the probability the forecaster assigned, that is:
Two features of the definition that are important to understand.
First, it is a per-bucket measurement, not an average over the whole population. A forecaster that says 10% half the time and 90% the other half, while the event historically always occurred at a 50% rate, averages out perfectly while being badly wrong in both buckets, when looking at calibration.
Second, calibration is a property of the forecaster over repetition. A single “30%” is never right or wrong on its own; only the population of 30%-forecasts can be judged. This is why calibration can only ever be measured against history, and why this whole subject reduces to a question about how much history you have.
When Historical Events are Abundant
With lots of forecast–outcome pairs the calibration becomes a simple procedure, but discipline is still required on 2 fronts
When history is abundant, checking calibration is exactly the bucket exercise, formalised:
- Collect historical forecast–outcome pairs.
- Bin the forecasts by their stated probability (0–10%, 10–20%, …).
- In each bin, compute how often the event actually happened.
- Plot actual frequency against stated probability. A calibrated forecaster’s points sit on the diagonal; the summary number (average gap from the diagonal, weighted by bin size) is the Expected Calibration Error (ECE) [2].
When every bin holds plenty of outcomes, this works comfortably, and most of the work on this site uses it wherever the data allows. But 2 cautions apply before trusting the picture that it paints.
The binned error depends on how you bin: coarse bins hide structure, fine bins manufacture noise, and the same forecaster gets different ECE numbers under different binning schemes. A number that changes when you change an arbitrary setting is not yet a measurement. An ECE quoted without its binning scheme is not reproducible. Always state the bins.
A forecaster you control. Set its true miscalibration (leave it at zero and the forecaster is perfect), then draw n outcomes per bucket. The dots are the observed frequencies; the shaded bands are where a perfect forecaster's dots wander at this n. Dots that stray outside their band turn madder. Watch a perfect forecaster still land far off the diagonal when n is small: that scatter is sampling noise, not bias.
Rare Events: The Width is the Message.
For small probabilities, how sure you are about the calibration measurement matters more than the measurement itself.
Now break the abundant case. You want to check a “1%” claim with 50 observations. On average, a bucket constructed to hold events from 0%-1% expects half an event, so there will be no data for you to measure against. This is a significant issue, especially when the tail of the distribution is what matters to you most, as it is sometimes the rare events that carry the most consequence.
If a p claim is honest, then over n independent chances the number of times the event happens, k, behaves like n flips of a coin that lands heads with probability p; that is, Binomial(n, p). Everything about “is k consistent with p?” follows from that: exact tests, and confidence intervals for the true rate given an observed k. The Kupiec test is this idea, formalised for risk-model backtesting. 1Kupiec (1995) [4], the standard backtest behind the Basel “traffic light” framework for bank VaR models: a likelihood-ratio test on the observed exceedance count against the count implied by the stated coverage.
Take the claim “an event happens 1% of the time” and test it with n = 100 trials, where a true 1% rate produces about one event on average. You observe some count k, and the real question is which values of k would actually let you judge the claim.
A tool for that is the 95% confidence interval on the true rate: given the k you saw, it is the range of true rates consistent with that observation. The test is simply whether the claimed 1% falls inside it. If it does, the data gives you no reason to reject the claim. Working through the small counts (these are Fig. 02’s numbers):
- k = 0 → true rate in [0%, 3.7%]
- k = 1 → [0.2%, 5.4%]
- k = 2 → [0.6%, 7.0%]
Every one of these brackets 1%, so observing 0, 1, or 2 events leaves the claim standing and none of them is evidence either way. The first count that even begins to bite is k = 3, whose interval [1.0%, 8.5%] puts 1% right on the boundary. And there the verdict splits by method [3]: the Wilson interval tips to “inconsistent” while an exact binomial test still accepts. When switching the test switches the answer, that is the finding: 100 observations cannot resolve a 1% claim.
The right move for small p is not to pretend the point estimate settles anything. It is to report the confidence interval on the coverage estimate itself, so whoever consumes the claim sees the width. “Empirical coverage 9% [3%, 21%]” and “9%” contain the same point estimate but completely different amounts of information: the first says what the data can and cannot support; the second launders a wide interval into false precision. All following sections in this article are a response to that width.
One more thing counting cannot see is the temporal dimension of the data. 10 events scattered over 10 years and 10 events in a single week produce the same count while describing completely different risks. Christoffersen’s test asks the follow-up question: do the events cluster? 2Christoffersen (1998) [5]: a likelihood-ratio test on the transition frequencies of the hit sequence; does a violation today make a violation tomorrow more likely? The standard companion to Kupiec in VaR backtesting. Clustering is the signature of regime-driven markets, so a coverage claim worth trusting states both facts: the count is right, and the events don’t bunch.
Pick a claimed probability p, a number of chances n, and an observed count k. The band is the 95% range of true rates consistent with seeing k out of n; the verdict is whether the claim sits inside it. This is Example 3.2 with sliders.
Narrowing the Width, and its Costs.
Four remedies, ordered by how much you must assume: waste less, pool, borrow structure, proxy.
Section 03 left us with intervals too wide to act on. The following are 4 ways to narrow them, and they form a ladder, each rung gaining precision at the cost of a stronger assumption. Knowing which rung you are standing on, and saying so, is most of the relevant information.
Waste less by using the Probability Integral Transform (PIT)
Binning throws information away: it reduces a rich forecast to “which bucket was it in”. If your forecasts are full distributions (a predicted range with probabilities over it, not just one number), there is a check that uses every observation: 3Three modes of “calibrated” are in play across this tutorial: event-probability calibration (§ 01), quantile/coverage calibration (the counting of § 03), and full-distribution calibration, which is what PIT tests. The definitions nest; the data demands differ.
For each realised outcome, ask the forecast: what fraction of your predicted distribution lay below what actually happened? That fraction, a number between 0 and 1, is the PIT value [6]. In words: where inside its own predicted range did reality land?
If the forecaster is honest, outcomes should land evenly across its predicted ranges: the PIT values are uniform on [0, 1]. Each kind of dishonesty leaves a signature shape instead: outcomes piling up at the edges mean the predicted ranges were too narrow; piling up in the middle means too wide; drifting to one side means the centre was off. Uniformity can be tested with standard tools, 4Kolmogorov–Smirnov uses the biggest gap between observed and uniform anywhere; Anderson–Darling weights the comparison toward the ends of the range, which in risk work is where being wrong costs most. [7] and here is the payoff: 50 observations can meaningfully test uniformity, because every outcome informs the test, whereas the same 50 observations could say nothing at all about a 1% bucket.
Assumption. Forecasts are full distributions (CDFs), not point probabilities, and observations independent enough to test uniformity.
Pick a forecaster defect and a sample size; outcomes are simulated and passed through the defective forecast. Each defect leaves its signature: a U means the predicted ranges were too narrow (overconfident), a hump means too wide (underconfident), a slope means the centre was off (biased), edge spikes mean the tails are heavier than the forecast believes. Learn these four shapes and you can read any PIT histogram in the wild.
Pool by Testing Many Related Series Together
If you forecast many related series (several assets, venues, time windows), test calibration jointly across all of them. This is the standard trick in weather verification [8], and it multiplies your effective sample. But a model that is fine on 9 series and broken on the 10th can hide inside the average, and because related series move together, treating their observations as independent claims more certainty than you have; the fixes (clustering the errors, block methods) exist, but must actually be used.
Assumption. Miscalibration is shared across the pooled series, and between-series dependence is handled.
Borrow Structure from Extreme Value Theory (EVT)
For tail probabilities specifically, there is a way to change what is being validated. Instead of testing the 1% estimate against 1% events you don’t have, fit a tail model to the 5–10% of observations beyond a moderate threshold, data you do have, and let a theorem carry the shape out to the far tail. 5The Pickands–Balkema–de Haan theorem: for a very broad class of distributions, excesses over a high threshold converge to a generalised Pareto. Stated, explained, and priced in background/extreme-value-theory. What the extrapolation costs, and how the tail model’s own uncertainty compounds with distance, is the subject of its own tutorial, background/extreme-value-theory; § 08 covers what to do when even this rung is unavailable.
Assumption. Threshold exceedances are regular enough to follow a generalised Pareto (much weaker than trusting a full model of everything, but genuine), and the tail model’s uncertainty compounds with extrapolation distance.
Proxy with Proper Scoring Rules
Scores like CRPS and the log score compare whole forecast distributions against outcomes [9], and they converge much faster than bucket-counting. The catch: they don’t test calibration in isolation; they mix it with how decisive the forecasts are (§ 09 makes that mixing exact). So use them the way you use a smoke detector: fast, sensitive, unspecific. A model that is badly wrong in the tails usually loses on CRPS long before you have enough tail events for a counting test to say anything. The scoring rule raises the alarm; the coverage test is the inspection that follows.
Assumption. That a good score means good calibration. It does not: the score blends calibration with sharpness, so read it as a fast, unspecific alarm, not an isolated calibration test.
Guarantees by Construction
Conformal prediction changes the question: from "is my interval calibrated?" (wait and see) to "does one structural assumption hold?" (reason now).
Every rung of the ladder still estimates calibration from history: collect data, measure, and hope the interval is narrow. Conformal prediction takes a different route entirely: build the interval so that its coverage is guaranteed by arithmetic, not estimated from outcomes.
Hold out n calibration points and score how wrong the model was on each. Build the interval for a new point from the k-th largest of those scores. Then the interval’s coverage is exactly , for any model, any distribution, any n, provided only that the data are exchangeable. 6Exchangeability: the data’s joint distribution doesn’t care about ordering, weaker than “independent and identically distributed”. It is the only assumption used. No distributional form, no model correctness. Choose and you have coverage of at least 90% by construction [10, 11].
In words: the trick is rank arithmetic rather than modelling. A new exchangeable point is equally likely to land at any rank among the calibration scores, so “below the k-th largest” happens exactly k out of n+1 times. Nothing was estimated; nothing needs to be verified against history. The question you must defend shifts from “is my 90% empirically calibrated?”, which § 03 showed needs mountains of data, to “is exchangeability plausible here?”, a structural question you can reason about and stress-test today.
2 honest caveats apply, and neither belongs in a footnote:
- The guarantee is marginal: it holds on average over everything, not within every subgroup. That gap is § 06.
- It degrades under distribution shift: if the world changes between calibration and use, the arithmetic no longer applies.
The shift problem has its own answer: adaptive variants (adaptive conformal inference [12], conformal PID control [13]) watch the realised miss rate and adjust the interval width to steer it back to target. That reverses the § 03 problem entirely: calibration stops being a fixed property you estimate from history and becomes a running property you enforce, day by day.
Calibration becomes a running property you enforce rather than a fixed property you estimate.
Top: Theorem 5.1 drawn: coverage is exactly k/(n+1), so the conformal choice of k (petrol) sits at or above the 90% target at every n, while the naive plug-in quantile (gold) sits below it at small n. No simulation; this is arithmetic. Bottom: a sequence whose scale doubles mid-stream. The fixed interval's rolling coverage collapses; the adaptive version misses, notices, widens, and walks back to target. The learning rate γ trades reaction speed against wobble.
Calibrated for Whom?
A forecaster can pass every check so far, averaged over everyone, while being wrong for everyone in particular.
Everything so far audits the margin: the track record pooled over all forecasts. Here is the failure that pooling hides: suppose a system’s “10%” forecasts come true 18% of the time on one venue and 3% of the time on another, in proportions that average to 10%. The marginal audit passes perfectly. Every single user is misled, each in a different direction. Nobody consumes a forecast at the margin: a holder is on a particular venue, in a particular regime, holding a particular coin, and the calibration statement they need is the one conditional on where they actually stand.
A forecaster is group-conditionally calibrated over a set of groups if the calibration property holds within each group, not just on average. (The machine-learning literature’s stronger cousin, holding across many overlapping groups at once, is called multicalibration [15].) The conformal version is Mondrian conformal prediction [10]: run Theorem 5.1’s construction separately within each group, and the coverage guarantee holds per group. The cost is § 03 all over again: each group must supply its own sample size, so the width problem returns at the group level, and the real design decision is which conditioning is worth its data cost. 7Full conditional coverage (validity for every conditioning event simultaneously) is provably unattainable distribution-free (Vovk 2012; Lei & Wasserman 2014) [14]. Groupwise validity over a chosen partition is the practical maximum.
Papers on this site that promise “group-conditional (Mondrian) coverage” are invoking exactly this section, and both halves of it must be read together. A group-conditional guarantee is only informative when it states both its groups and their sample sizes.
When the Audit Fails: Recalibration
Diagnosis is not treatment; a failed check can often be repaired, at a price paid in data.
Suppose the audit rejects: the stated probabilities are systematically off. The good news is that systematic distortion can be undone: relearn the map from the model’s raw outputs to honest probabilities, using held-out data. The standard options, from most to least assumed:
- Platt / temperature scaling. Fit a 1- or 2-parameter squashing curve from raw scores to probabilities. Cheap and stable, but only able to fix distortions its simple shape can express [16, 2].
- Isotonic regression. Drop the fixed shape; fit any map that never decreases. Fixes more, needs considerably more calibration data [17].
- Conformal recalibration. Don’t trust the model at all: wrap its outputs in the § 05 construction, and the coverage guarantee is restored by arithmetic.
3 caveats keep this honest:
- Recalibration spends data: the held-out set it learns from is data the audit can no longer use.
- It repairs only stable distortion: a map learned in one regime transfers to the next only if the distortion does.
- It inherits both earlier problems: in the tails it faces § 03’s widths, and across subgroups it faces § 06’s question, recalibrated for whom?
A recalibrated forecaster is a new forecaster, and it queues for the same audit as the old one.
The Genuinely Rare
For the 0.1% event you have never seen, the defensible output is a bound with its assumptions showing.
Some regimes defeat the whole ladder: the event has essentially never happened, and no pooling or tail-fitting manufactures the missing observations. What remains is a protocol, not a calculation:
- Say out loud that the tail probability is model-derived and unvalidated, in the report, not the appendix.
- Show sensitivity: how does the answer move as the tail model’s key assumption varies over its own confidence range? (Fig. 05 does exactly this.)
- Use the output as a bound or a stress input, never as a point estimate in downstream arithmetic.
Bayesian shrinkage toward a conservative prior is the same move in a different vocabulary: with 2 tail events, your posterior is mostly prior, and saying so out loud is a strength. The failure mode both vocabularies guard against is the same one: presenting a model’s opinion as if it were a measured fact.
Step 2 of Recipe 8.1, executed. The far quantile is a formula in the fitted tail-shape ξ; give ξ the confidence band your data actually supports and read off the range it induces on the answer you wanted. The readout that matters is the ratio: a modest band on the assumption becomes a multiple on the far answer.
What Calibration Cannot See
A forecaster can be perfectly calibrated and perfectly useless; the missing property is sharpness.
Meet the climatological forecaster: whatever the situation, it says the historical average. If it rains on 12% of days, it says “12%” every single day, rain or shine. This forecaster is perfectly calibrated (among all the days it said 12%, it rained on exactly 12%, by construction) and it tells you nothing. It never distinguishes one day from another. Every check in this tutorial passes it.
What it lacks is sharpness: how concentrated, how decisive, the forecasts are, a property of the forecasts alone, before any outcome arrives. A sharp forecaster says 2% on most days and 85% when the front is coming in; it takes stands. The right goal, in the standard formulation due to Gneiting and colleagues [19], is to maximise sharpness subject to calibration: calibration is the constraint that keeps the probabilities honest; sharpness is the objective that makes them worth having.
The Brier score (the average squared gap between stated probability and what happened) splits exactly into 3 parts [18]:
In words: a penalty for dishonest probabilities (reliability: zero for a calibrated forecaster), minus a reward for taking stands that pay off (resolution: how far the bucket frequencies sit from the base rate), plus a floor set by the world’s own unpredictability (uncertainty: π(1−π), which no forecaster can change). The climatological forecaster scores exactly the floor: no penalty, no reward. Every point a sharp, calibrated forecaster gains over it is pure resolution. This also delivers § 4.4’s promise: a proper score prices honesty and decisiveness in one number, and the decomposition tells you which one is moving.
The division of labour matters for how this tutorial gets used. Calibration is the licence: the property that makes a stated probability a claim about the world rather than an opinion. It is not the achievement. Papers on this site that pin here are, almost always, invoking the licence half; whether the forecasts in question are also worth having is a separate question, with a separate literature, and a separate background article when the rule of two demands it.
A forecaster watches a noisy signal about a two-state world and reports the exact honest probability given what it saw, so it is calibrated by construction at every slider setting. At signal quality 0.5 it is the climatological forecaster of Intuition 9.1: one forecast, the base rate. Toward 1.0 it takes stands. Watch the left panel never leave the diagonal while the Brier score falls: every point of improvement is resolution, and the reliability penalty reads 0.000 the whole way.
- Dawid, A.P. (1982). The well-calibrated Bayesian. J. Amer. Statist. Assoc. — Definition 1.1’s origin.
- Naeini, M.P., Cooper, G.F., Hauskrecht, M. (2015). Obtaining well calibrated probabilities using Bayesian binning. AAAI; Guo, C., Pleiss, G., Sun, Y., Weinberger, K.Q. (2017). On calibration of modern neural networks. ICML. — the ECE of Recipe 2.1, and the temperature scaling of Recipe 7.1.
- Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. J. Amer. Statist. Assoc.; Clopper, C.J., Pearson, E.S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika. — the two intervals whose verdicts split in Example 3.2.
- Kupiec, P. (1995). Techniques for verifying the accuracy of risk measurement models. J. Derivatives. — Remark 3.1’s counting test.
- Christoffersen, P. (1998). Evaluating interval forecasts. Int. Econ. Rev. — the clustering test of § 03.
- Rosenblatt, M. (1952). Remarks on a multivariate transformation. Ann. Math. Statist.; Diebold, F.X., Gunther, T.A., Tay, A.S. (1998). Evaluating density forecasts with applications to financial risk management. Int. Econ. Rev. — the transform of Definition 4.1 and its use on forecasts.
- Kolmogorov, A. (1933). Sulla determinazione empirica di una legge di distribuzione. G. Ist. Ital. Attuari; Anderson, T.W., Darling, D.A. (1952). Asymptotic theory of certain “goodness of fit” criteria based on stochastic processes. Ann. Math. Statist. — the uniformity tests of § 4.1.
- Hamill, T.M. (2001). Interpretation of rank histograms for verifying ensemble forecasts. Mon. Wea. Rev. — pooled verification practice, § 4.2.
- Gneiting, T., Raftery, A.E. (2007). Strictly proper scoring rules, prediction, and estimation. J. Amer. Statist. Assoc. — the scores of § 4.4.
- Vovk, V., Gammerman, A., Shafer, G. (2005). Algorithmic Learning in a Random World. Springer. — conformal prediction in full, including the Mondrian construction of § 06.
- Papadopoulos, H., Proedrou, K., Vovk, V., Gammerman, A. (2002). Inductive confidence machines for regression. ECML; Lei, J., G’Sell, M., Rinaldo, A., Tibshirani, R.J., Wasserman, L. (2018). Distribution-free predictive inference for regression. J. Amer. Statist. Assoc. — split conformal (Theorem 5.1) and its modern treatment.
- Gibbs, I., Candès, E. (2021). Adaptive conformal inference under distribution shift. NeurIPS. — § 05’s first shift correction.
- Angelopoulos, A.N., Candès, E., Tibshirani, R.J. (2023). Conformal PID control for time series prediction. NeurIPS. — § 05’s second shift correction.
- Vovk, V. (2012). Conditional validity of inductive conformal predictors. ACML; Lei, J., Wasserman, L. (2014). Distribution-free prediction bands for non-parametric regression. J. R. Statist. Soc. B. — the impossibility results behind § 06’s sidenote.
- Hébert-Johnson, U., Kim, M.P., Reingold, O., Rothblum, G.N. (2018). Multicalibration: calibration for the (computationally-identifiable) masses. ICML. — § 06’s stronger cousin.
- Platt, J. (1999). Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. In Advances in Large Margin Classifiers. MIT Press. — Recipe 7.1’s first repair.
- Zadrozny, B., Elkan, C. (2002). Transforming classifier scores into accurate multiclass probability estimates. KDD. — isotonic recalibration, Recipe 7.1.
- Brier, G.W. (1950). Verification of forecasts expressed in terms of probability. Mon. Wea. Rev.; Murphy, A.H. (1973). A new vector partition of the probability score. J. Appl. Meteor. — the score and its decomposition, Theorem 9.2.
- Gneiting, T., Balabdaoui, F., Raftery, A.E. (2007). Probabilistic forecasts, calibration and sharpness. J. R. Statist. Soc. B. — § 09’s maximise-sharpness-subject-to-calibration principle.