Bayes' theorem — updating beliefs with evidence
▸ Pretest — guess, even if you don't know
A disease affects 1% of a population. A test catches 99% of true cases, but also gives a false positive on 5% of healthy people. You test positive. Roughly what's the probability you have the disease?
Two lines of algebra
You already own everything needed to derive Bayes' theorem. Quick reading reminder from A1-05: is read "the probability of A given B" — the chance A is true once you know B happened. One new symbol: is read "and", so is "the probability that A and B both happen" — the joint probability.
From A1-05, that joint probability factors two ways:
In words: the probability of "A and B both" equals the probability of B, times the probability of A given B. It also equals the probability of A, times the probability of B given A. Two routes, same number.
Divide both sides by :
In words: the probability of A given B equals the probability of B given A, times the probability of A on its own, divided by the probability of B on its own. (The horizontal bar is a fraction: top divided by bottom.)
That's it — that is Bayes' theorem. It is the exchange rate between the two conditionals from A1-05's inversion trap: it converts "probability of B given A" into "probability of A given B". And — the base rate, also called the prior — your probability for A before seeing any evidence — is what you pay at the exchange.
In practice is expanded over the ways can happen. One more symbol: is read "not A" — the event that A does not happen:
In words: the bottom adds up the two ways B can occur — B happening when A is true, plus B happening when A is false. So evidence can come from the world where is true, or from the world where it isn't. The posterior — your updated probability of A after seeing the evidence — is just the share of all -occurrences that come from the -world.
The diagnostic example, in counts
Formulas hide intuition; counts reveal it. Take 10,000 people. The disease base rate is 1%, so 100 of them actually have it. Sensitivity — the share of real cases the test catches — is 99%. The false-positive rate — the share of healthy people who wrongly test positive anyway — is 5%:
| Test positive | Test negative | Total | |
|---|---|---|---|
| Diseased | 99 | 1 | 100 |
| Healthy | 495 | 9,405 | 9,900 |
In words: the probability of disease given a positive test is the number of true positives (99) divided by the number of all positives (99 + 495 = 594). The sign reads "approximately equals": about 0.167, i.e. 17%.
The false positives (495) swamp the true positives (99) — not because the test is bad, but because healthy people outnumber diseased ones 99 to 1. When the condition you're testing for is rare, even a good test yields mostly false alarms.
Your backtest passed. So what?
Now the version of this problem you will live inside for the rest of this curriculum. A backtest — a simulation of a trading strategy on historical data — plays the role of the medical test. Replace "disease" with "strategy has a real edge" and "positive test" with "backtest looks good":
- Prior: most strategy ideas have no edge. Be generous and say 5% of the ideas you'll ever test are genuinely good.
- Power — the chance the test detects a real effect when one exists: a good backtest protocol catches a real edge, say, 60% of the time (real edges are small and noisy — more in A2-04).
- False pass rate: a no-edge strategy passes anyway 5% of the time. (That 5% is the classic significance threshold — the error rate statistical convention tolerates — A2-05.)
In words: the probability of a real edge given a passing backtest. The top is the chance of "real edge AND pass": 0.60 × 0.05 = 0.030. The bottom is the chance of a pass from either world: passes from real edges (0.030) plus lucky passes from the 95% of no-edge strategies (0.05 × 0.95). Divide: 0.030 / 0.0775, approximately 0.39.
A passing backtest, under honest and even somewhat optimistic assumptions, means roughly a 39% chance the strategy is actually good. Less than a coin flip. The pass moved you from 5% to 39% — genuinely valuable evidence. But treating it as a verdict ("it works!") is the diagnostic fallacy — mistaking "probability of a pass given an edge" for "probability of an edge given a pass" — with money attached.
And it gets worse. If you tested 100 variations and kept the best-looking one, your effective false-pass rate is far above 5%, and the posterior collapses back toward the prior. That is the multiple-testing problem — try enough things and something will pass by pure luck. A2-05 treats it in full; Bayes is why it's lethal.
Beliefs are distributions, not verdicts
The deeper shift Bayes asks of you: stop treating claims as true/false flags waiting to be set. Start treating them as probabilities that move as evidence arrives. Before the backtest: 5%. After one clean pass: 39%. After a year of live trading in line with the backtest: higher still. After a live year that looks nothing like the backtest: back down.
Nothing is ever "proven" — you just accumulate evidence and update. Full Bayesian statistics builds an entire inference framework on this one theorem. There, priors and posteriors are placed over parameters — the unknown numbers inside a model — not just over events. McElreath's Statistical Rethinking is the classic on-ramp. For now, the discipline to internalize is: always ask what the base rate is before celebrating a positive signal.
⧉ Review cardState Bayes' theorem.
⧉ Review cardDisease base rate 1%, test sensitivity 99%, false-positive rate 5%. Why is P(disease given positive) only about 17%?
⧉ Review cardYour backtest passed. Why is the probability the strategy is genuinely good still low?
⧉ Review cardWhat is the Bayesian stance toward beliefs about strategies?
Predict before the next lesson
Next lesson: the Law of Large Numbers and the Central Limit Theorem — the machinery behind "more data reveals the truth." Predict:
- You flip a fair coin 1,000 times. Roughly what range of head-counts would surprise you?
- A casino's edge on one roulette spin is about 5%, yet a single gambler can walk away a winner. Why is the casino nonetheless certain to profit over a million spins?
- Yesterday's Bayes posterior of 39% was based on one backtest. What kind of additional evidence would push it above 90% — and how much of it do you guess you'd need?
Note your answers. We check them against the math next.
◈ Calibration check
Could you set up and compute a Bayes update from a base rate, a hit rate, and a false-alarm rate?
1 = guessing · 5 = could teach it
⏻ End of lesson
Mark it read to book its 4 review cards into your deck.
Sources & further reading
- bookWasserman (2004), All of Statistics — §1, 2
- bookKahneman (2011), Thinking, Fast and Slow — §16
- bookMcElreath (2020), Statistical Rethinking, 2e — §1, 2