0bps

Learn / Track I / lesson 2 of 4

Conditional probability and Bayes' rule

How to update a belief when new evidence arrives — the single most-tested idea in quant interviews, and the core of every signal.

10 min read

A trading signal is evidence. The question is never “is the signal on?” but “given that the signal is on, how likely is the outcome I care about?” That is a conditional probability.

Conditional probability

The probability of AA given that BB has happened is

P(A∣B)=P(A∩B)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}

You restrict the universe to the cases where BB is true, and ask what fraction of those also have AA.

Bayes’ rule

Rearranging the definition both ways gives Bayes’ rule:

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

with the denominator usually expanded by the law of total probability:

P(B)=P(B∣A)P(A)+P(B∣Ac)P(Ac)P(B) = P(B \mid A)P(A) + P(B \mid A^c)P(A^c)

The pieces have names. P(A)P(A) is the prior (what you believed before), P(B∣A)P(B \mid A) is the likelihood (how expected the evidence is if AA is true), and P(A∣B)P(A \mid B) is the posterior.

Worked example: a “95% accurate” signal

A crash-warning model flags 95% of real crashes, and falsely flags 10% of normal weeks. Crashes happen in 2% of weeks. The model is flashing. How worried should you be?

P(crash∣flag)=0.95×0.020.95×0.02+0.10×0.98=0.0190.117≈16%P(\text{crash} \mid \text{flag}) = \frac{0.95 \times 0.02}{0.95 \times 0.02 + 0.10 \times 0.98} = \frac{0.019}{0.117} \approx 16\%

The “95% accurate” model is wrong about five times in six when it fires, because the thing it detects is rare. This is base-rate neglect, and it explains most disappointing signals.

Thinking in odds

Bayes is cleaner in odds form. Writing O(A)=P(A)/P(Ac)O(A) = P(A)/P(A^c):

O(A∣B)=O(A)×P(B∣A)P(B∣Ac)O(A \mid B) = O(A) \times \frac{P(B \mid A)}{P(B \mid A^c)}

Posterior odds equal prior odds times the likelihood ratio. In the example the prior odds are 2:982{:}98, the likelihood ratio is 9.59.5, so the posterior odds are 19:9819{:}98, about 16%. Each new independent piece of evidence simply multiplies in another likelihood ratio, which is why combining several weak, independent signals can be powerful.

Independence

AA and BB are independent when P(A∣B)=P(A)P(A \mid B) = P(A), equivalently P(A∩B)=P(A)P(B)P(A \cap B) = P(A)P(B). Markets break independence constantly: large moves cluster, assets that look unrelated move together in a crisis. Treat independence as an assumption to be checked, never a default.

Common mistake

Confusing P(B∣A)P(B \mid A) with P(A∣B)P(A \mid B). “Most big winners had high momentum” is P(momentum∣winner)P(\text{momentum} \mid \text{winner}). What you trade on is P(winner∣momentum)P(\text{winner} \mid \text{momentum}), which can be far smaller if most high-momentum stocks don’t become big winners.

Interview classics

  • Two children. A family has two children and at least one is a boy. The probability both are boys is 1/31/3, not 1/21/2: of the equally likely cases BB, BG, GB, only one of the three remaining is BB.
  • Monty Hall. You pick a door; the host, who knows where the car is, opens a different door showing a goat. Switching wins with probability 2/32/3, because your first pick was right only 1/31/3 of the time and the host’s action never changes that.
  • The biased coin. One of 100 coins is double-headed. You draw one at random and flip ten heads. The posterior that it’s the double-headed coin is 1/1001/100+(99/100)(1/2)10≈91%\frac{1/100}{1/100 + (99/100)(1/2)^{10}} \approx 91\%.

Practise more in the question bank.

esc

Try , , or .

↑↓ move↵ open