QTQuant Terminal
A1-06A1·intro·~16 min

Bayes' theorem — updating beliefs with evidence

probabilitybayesbase-ratesbacktesting

▸ 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. From A1-05, the joint probability factors two ways:

P(AB)=P(AB)P(B)=P(BA)P(A)P(A \cap B) = P(A \mid B)\,P(B) = P(B \mid A)\,P(A)

Divide by P(B)P(B):

P(AB)=P(BA)P(A)P(B)P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}

That's it. Bayes' theorem is the exchange rate between the two conditionals from A1-05's inversion trap — and P(A)P(A), the base rate (or prior), is what you pay at the exchange.

In practice P(B)P(B) is expanded over the ways BB can happen:

P(AB)=P(BA)P(A)P(BA)P(A)+P(B¬A)P(¬A)P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B \mid A)\,P(A) + P(B \mid \neg A)\,P(\neg A)}

The denominator says: evidence BB can come from the world where AA is true, or from the world where it isn't. The posterior is just the share of BB-occurrences that come from the AA-world.

The diagnostic example, in counts

Formulas hide intuition; counts reveal it. Take 10,000 people, disease base rate 1%, sensitivity 99%, false-positive rate 5%:

Test positiveTest negativeTotal
Diseased991100
Healthy4959,4059,900

P(diseasepositive)=9999+495=995940.167P(\text{disease} \mid \text{positive}) = \frac{99}{99 + 495} = \frac{99}{594} \approx 0.167

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. Replace "disease" with "strategy has a real edge" and "positive test" with "backtest looks good":

P(edgepass)=0.60×0.050.60×0.05+0.05×0.95=0.0300.07750.39P(\text{edge} \mid \text{pass}) = \frac{0.60 \times 0.05}{0.60 \times 0.05 + 0.05 \times 0.95} = \frac{0.030}{0.0775} \approx 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 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 toward the prior. That is the multiple-testing problem, which A2-05 treats 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, and 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 (priors and posteriors over parameters, not just events — McElreath's Statistical Rethinking is the classic on-ramp) builds an entire inference framework on this one theorem. For now, the discipline to internalize is: always ask what the base rate is before celebrating a positive signal.

⧉ Review card
State Bayes' theorem.
P(A given B) = P(B given A) P(A) / P(B). Derived in one step from the two factorizations of P(A and B). It converts one conditional into the other, at the price of the base rate P(A).
⧉ Review card
Disease base rate 1%, test sensitivity 99%, false-positive rate 5%. Why is P(disease given positive) only about 17%?
Per 10,000 people: 99 true positives but 495 false positives (5% of 9,900 healthy). 99 / 594 ≈ 17%. When a condition is rare, false alarms from the huge healthy pool swamp the true hits.
⧉ Review card
Your backtest passed. Why is the probability the strategy is genuinely good still low?
Bayes with an honest prior: most strategy ideas (say 95%) have no edge. Even with 60% power and a 5% false-pass rate, P(edge given pass) ≈ 0.03 / 0.0775 ≈ 39%. A pass is evidence, not a verdict — and multiple testing degrades it further.
⧉ Review card
What is the Bayesian stance toward beliefs about strategies?
Beliefs are probabilities to be updated as evidence arrives, not flags to be set. A backtest pass moves the probability up; contradictory live results move it down. Nothing is ever proven — evidence accumulates.

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:

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