Member-only story
Do You Think Like A Bayesian?
You’re watching American TV, and an overproduced commercial informs you there’s a rare genetic condition preventing you from strolling through life surrounded by ridiculously attractive people frolicking through a lush park. While gleeful couples smile and breathe in vibrant, CGI-enhanced air, the ad insists you might be missing out on life because of this obscure ailment you never knew you had. Clearly, the only solution is to ask your doctor about Griftapril™.
The doctor is going to get paid either way, so he agrees to run a test for a rare condition that only one in every ten thousand people have. The test is highly accurate — 99% sensitive and 99% specific — which you interpret as: “If I test positive, I’m basically guaranteed to have it.”
And guess what? You tested positive.
Luckily for you, though, your doctor read this exceptionally clear blog post about Bayesian reasoning and tells you the chance of having the disease is not 99% but actually less than 1%.
And guess what? He’s right!
How can that be?
Deriving Bayes’ Rule
Bayes’ rule comes from a simple fact about probabilities. For two events, A (e.g., having the disease) and B (e.g., testing positive), the probability of both events happening can be written in two ways:
- First, you can think of it as the probability of A happening given B, multiplied by the probability of B:
P(A and B) = P(A given B) × P(B). - Alternatively, you can think of it as the probability of B happening given A, multiplied by the probability of A:
P(A and B) = P(B given A) × P(A).
Since both expressions describe the same thing, you can set them equal and rearrange them to find:
P(A given B) = [P(B given A) × P(A)] ÷ P(B).
Here’s what each term means:
- P(A): Your prior belief about A before seeing the evidence (e.g., how likely the disease is in the population — 1 in 10,000 in the hypothetical scenario).
- P(B given A): The likelihood of B occurring if A were true (e.g., how accurate the test is when someone has the disease — 99 times out of 100 for our 99% sensitive test).