Bayes' Theorem

The mathematical framework for updating your beliefs in light of new evidence.

From Prior to Posterior

Bayes' Theorem is one of the most important concepts in probability and statistics. It provides a formal way to combine new evidence with existing beliefs (our "priors") to arrive at an updated, more accurate belief (a "posterior").

P(AB)=P(BA)P(A)P(B)P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}
  • P(A|B) — The Posterior Probability: The probability of event A being true, given that event B is true. This is what you are trying to calculate.
  • P(B|A) — The Likelihood: The probability of observing event B, given that event A is true. (This is often the accuracy of your test or signal).
  • P(A) — The Prior Probability: Your initial belief in the probability of event A before seeing any new evidence.
  • P(B) — The Marginal Probability: The total probability of observing event B under all circumstances.
Interactive Calculator: The Disease Test
A person tests positive for a rare disease. What's the real probability they have it? This visualization shows how a low base rate can produce many false positives. This is the "base rate fallacy".

P(Disease)

P(Positive | Disease)

P(Negative | No Disease)

100
Have Disease
9,900
Are Healthy

Test Results

True Positives
99
False Positives
495
True Negatives
9405
False Negatives
1

Given a POSITIVE test result, the probability of actually having the disease is:

16.67%

(True Positives / All Positives)

Sick & Positive
Healthy & Positive