Panglossian Fallacy
Thinking about statistics
Fallacy
Intermediate
The flip side of the hindsight fallacy.
What it is
The term comes from a comment Gelman wrote in a 2016 discussion of Leicester City, the football club that won the English Premier League at odds of 5000 to 1. The hindsight fallacy looks back at an outcome and decides it was predictable all along. The Panglossian fallacy, named after Dr. Pangloss in Voltaire’s Candide, who believes all is for the best in the best of all possible worlds, assumes the opposite: that the prospective judgment must have been right, so the outcome was simply a freak.
Gelman: “just as we need to beware of the hindsight fallacy, we also should watch out for the Panglossian fallacy. There are various reasons that the odds for Leicester could have been set wrong, including the very simple idea that not many people were betting on Leicester to win the championship so there was not much of a mechanism to keep prices honest. Again, people do make mistakes, even prospectively. If you want to argue that the bookies were doing their best, sure, I don’t disagree with that. But that’s the point, that maybe they were working off a flawed model, or maybe they just didn’t bother to try to get the odds right because the loss was such a low-probability event.”
Why it matters
After a surprising event, there are two lazy explanations. One says it was obvious all along. The other says the experts’ odds were right and this was just the one-in-5,000 season. Both skip the real question, which is whether the forecast was any good. Odds, risk scores and model predictions can be badly wrong for rare events in particular, because so little data and so little money test them. A single outcome can’t settle that, but a track record can. Gelman’s suggestion: “the best way to adjudicate these claims would be to look at calibration of this and other historical odds using precursor data such as point totals and goal differentials (as the N is not large enough to calibrate based on counting championships).”
How it works
Odds are calibrated if events priced at probability \(p\) happen about a fraction \(p\) of the time. One long shot coming in says almost nothing, since it would happen now and then even with perfect odds. Many priced events, grouped by their implied probability, show whether the odds were right. If long shots priced at \(p\) actually happen at rate \(k\,p\), the odds were off by a factor of \(k\), however hard the bookmakers were trying.
Simulated example
A toy calibration check, our own. A bookmaker prices many events, from favorites to extreme long shots. Its model can underprice long shots by a factor \(k\): an event priced at 1 in 1,000 really happens about \(k\) times in 1,000. With \(k = 1\) the Panglossian assumption is true and the odds are right. Look at the observed win rates against the implied probabilities.
Show simulation code
The R version uses base R, and the Python version uses NumPy and Matplotlib. Where the simulation draws random numbers, each language draws its own, so exact numbers differ slightly but show the same pattern. The numbered markers in the R code are explained under it.
import {rng, range, sum, fmt} from "../js/stats.js"
viewof k = Inputs.range([1, 10], {value: 4, step: 0.5, label: "How much long shots are underpriced (k)"})
viewof nEvents = Inputs.range([1000, 50000], {value: 20000, step: 1000, label: "Priced events in the track record"})
viewof seed = Inputs.range([1, 500], {value: 116, step: 1, label: "Random seed"})
calibration = {
const r = rng(seed);
// Implied probabilities spread evenly on the log scale, from 1 in 5,000 to 1 in 2.
const events = range(nEvents).map(() => {
const implied = Math.exp(Math.log(1 / 5000) + r() * Math.log(5000 / 2));
const odds = k * implied / (1 - implied); // true odds are k times the implied odds
return {implied, won: r() < odds / (1 + odds)};
});
const edges = [1 / 5000, 1 / 1000, 1 / 200, 1 / 50, 1 / 10, 1 / 2];
const bins = range(edges.length - 1).map(i => {
const e = events.filter(d => d.implied >= edges[i] && d.implied < edges[i + 1]);
const wins = e.filter(d => d.won).length, expected = sum(e.map(d => d.implied));
const mid = Math.sqrt(edges[i] * edges[i + 1]);
return {mid, implied: expected / e.length, observed: wins / e.length, lo: Math.max(1e-5, (wins - 2 * Math.sqrt(wins)) / e.length), hi: (wins + 2 * Math.sqrt(wins) + 2) / e.length, wins, expected, n: e.length};
});
const longShots = bins.slice(0, 3);
const w = sum(longShots.map(b => b.wins)), x = sum(longShots.map(b => b.expected));
return {bins, longWins: w, longExpected: x};
}
Plot.plot({
ariaLabel: "Panglossian Fallacy: calibration chart",
ariaDescription: "Horizontal axis: probability implied by the odds, log scale. Vertical axis: observed win rate, log scale, with a range of about two standard errors. The diagonal line is where calibrated odds would fall. The chart updates with the controls above it, and the summary below the charts states the result in words.",
height: 320,
x: {type: "log", label: "Probability implied by the odds (log scale)", domain: [1e-4, 1], grid: true},
y: {type: "log", label: "Observed win rate (log scale)", domain: [1e-4, 1], grid: true},
marks: [
Plot.line([{x: 1e-4, y: 1e-4}, {x: 1, y: 1}], {x: "x", y: "y", stroke: "currentColor", strokeDasharray: "4 3"}),
Plot.ruleX(calibration.bins.filter(b => b.wins > 0), {x: "implied", y1: "lo", y2: "hi", stroke: "#2166ac"}),
Plot.dot(calibration.bins.filter(b => b.wins > 0), {x: "implied", y: "observed", fill: "#2166ac", r: 5})
]
})# Panglossian Fallacy: assuming the odds were right because they're odds.
1k <- 4 # how much long shots are underpriced
n_events <- 20000 # priced events in the track record
2set.seed(116)
# Implied probabilities from 1 in 5,000 to 1 in 2, even on the log scale
implied <- exp(log(1 / 5000) + runif(n_events) * log(5000 / 2))
3true_odds <- k * implied / (1 - implied) # true odds k times implied odds
won <- runif(n_events) < true_odds / (1 + true_odds)
edges <- c(1 / 5000, 1 / 1000, 1 / 200, 1 / 50, 1 / 10, 1 / 2)
bin <- cut(implied, edges, right = FALSE)
4calib <- data.frame(
implied = tapply(implied, bin, mean),
observed = tapply(won, bin, mean)
)
print(signif(calib, 2))
long <- as.integer(bin) <= 3 # long shots: worse than 1 in 50
5ratio <- sum(won[long]) / sum(implied[long])
se <- sqrt(max(sum(won[long]), 1)) / sum(implied[long])
cat("Long shots won ", round(ratio, 1), " times as often as the odds ",
"implied\n", if (ratio - 2 * se > 1) {
"The odds were wrong."
} else {
"Consistent with calibrated odds."
}, "\n",
sep = ""
)
6plot(calib$implied, calib$observed,
log = "xy", pch = 19, col = "#d6604d",
xlab = "Implied probability", ylab = "Observed win rate"
)
abline(0, 1, lty = 2)- 1
- The page’s controls: how much the market underprices long shots, and how many priced events are in the record.
- 2
- Fixes the random numbers so the run is reproducible.
- 3
- The true odds of each event, k times the odds the market implied: the market is wrong about long shots.
- 4
- Calibration: the observed win rate in bins of implied probability.
- 5
- How much more often long shots won than the odds implied, and whether the gap is beyond chance.
- 6
- Observed against implied win rates. Points above the diagonal are the market’s long-shot error, visible only because someone checked.
# Panglossian Fallacy: assuming the odds were right because they're odds.
import numpy as np
import matplotlib.pyplot as plt
k = 4 # how much long shots are underpriced
n_events = 20000 # priced events in the track record
rng = np.random.default_rng(116)
# Implied probabilities from 1 in 5,000 to 1 in 2, even on the log scale
implied = np.exp(np.log(1 / 5000) + rng.uniform(size=n_events)
* np.log(5000 / 2))
true_odds = k * implied / (1 - implied) # true odds k times implied odds
won = rng.uniform(size=n_events) < true_odds / (1 + true_odds)
edges = [1 / 5000, 1 / 1000, 1 / 200, 1 / 50, 1 / 10, 1 / 2]
bin_ = np.digitize(implied, edges) - 1
mean_implied = [implied[bin_ == b].mean() for b in range(5)]
observed = [won[bin_ == b].mean() for b in range(5)]
for a, o in zip(mean_implied, observed):
print(f"implied {a:.2g} -> observed {o:.2g}")
long = bin_ <= 2 # long shots: worse than 1 in 50
ratio = won[long].sum() / implied[long].sum()
se = np.sqrt(max(won[long].sum(), 1)) / implied[long].sum()
print(f"Long shots won {ratio:.1f} times as often as the odds implied")
print("The odds were wrong." if ratio - 2 * se > 1
else "Consistent with calibrated odds.")
plt.loglog(mean_implied, np.maximum(observed, 1e-5), "o", color="#d6604d")
plt.plot([2e-4, 0.5], [2e-4, 0.5], "k--")
plt.xlabel("Implied probability")
plt.ylabel("Observed win rate")
plt.show()Key takeaways
- The hindsight fallacy says the outcome was predictable. The Panglossian fallacy says the prediction must have been right.
- “The bookies were doing their best” doesn’t mean their odds were right. People make mistakes prospectively too, especially about rare events that few people bet on.
- One outcome can’t settle whether a forecast was good. Check its calibration across many forecasts, using precursor data when the events themselves are rare.
Source
- Andrew Gelman, comment on Leicester City’s title odds (2016).