Bayes' theorem
Bayes' theorem turns P(B given A) into P(A given B): P(A given B) = P(B given A) x P(A) / P(B). It updates a belief after seeing evidence, using the base rate.
Last updated
Analogy
A smoke alarm rings. Before you panic, you weigh the alarm against how rarely your kitchen actually catches fire.
Example
1% have the diseaseTest catches 90% of themFalse alarm for 5% of healthy peopleP(positive) = 0.009 + 0.0495 = 0.0585P(disease given positive) = 0.009 / 0.0585 = 0.154
In practice
It shows why a positive result on a test for a rare disease is often a false alarm.
Practice
Flashcards
- State Bayes' theorem.P(A given B) = P(B given A) x P(A) / P(B).
Interview questions
- Explain, with numbers, why a positive result from a good test for a rare disease may still probably be a false alarm.
- Base rate is low
- Healthy people far outnumber sick people
- False positives from the many exceed true positives from the few
- Apply Bayes' theorem
Questions people ask
Why is a positive test often wrong for rare diseases?
Because healthy people vastly outnumber sick ones. In the example, 5 percent of 99 percent healthy people give 4.95 percent false alarms, far more than the 0.9 percent true positives. So only about 15 percent of positives are truly ill.
What is a base rate and why does it matter?
The base rate is how common something is before any evidence. Ignoring it is called base rate neglect. A highly accurate test still produces mostly false alarms when the condition is rare, because the pool of healthy people is so large.