What is going on?
Bayes’ theorem updates a prior probability after new evidence. The numerator counts signals from the event of interest. The denominator counts all signals, including false positives. Thinking in counts often makes the result easier to understand than thinking only in percentages.
Work through it
- Multiply the prior probability by the true-positive rate.
- Multiply the probability of the event being absent by the false-positive rate.
- Divide the first result by the sum of both results.
Put numbers to the idea
Imagine 10,000 items, with 1% defective. A check flags 90% of defective items and 5% of good items. It flags 90 defective items and 495 good items. Among flagged items, 90 / 585 ≈ 15.38% are defective.
A little more clarity
What is a prior probability?
It is the probability of the event before considering this particular signal. In the worked example, it is the fraction of items that are defective.
Is specificity the same as false-positive rate?
Specificity is the true-negative rate. False-positive rate equals 1 minus specificity, so 95% specificity corresponds to a 5% false-positive rate.
Why can the posterior be undefined?
When neither group can produce the signal, the denominator is zero. Conditioning on that impossible signal has no defined result in this model.