Bayes' Theorem
A fundamental theorem for updating probabilities based on new evidence.
Bayes' Theorem
Concept Overview
Bayes' Theorem is a powerful mathematical formula that describes how to update the probability of a hypothesis when given new evidence or information. Rather than treating probabilities as fixed values, the Bayesian approach views them as degrees of belief that should change as we gather more data. It shows us mathematically why we must consider both the new evidence (the test result) and our prior knowledge (the base rate) to reach a valid conclusion.
Definition
The theorem relates the conditional and marginal probabilities of two random events, A and B. It is stated mathematically as:
- P(A|B): The Posterior probability - the probability of event A occurring given that event B has occurred.
- P(B|A): The Likelihood - the probability of event B occurring given that event A is true.
- P(A): The Prior probability - the initial probability of event A before considering the new evidence B.
- P(B): The Evidence or Marginal Likelihood - the total probability of event B occurring under all possible conditions.
Key Concepts
Prior vs. Posterior Probability
The prior probability, P(A), is what we believe before seeing the evidence. The posterior probability, P(A|B), is what we believe after updating our prior with the new evidence. This updating mechanism forms the core of Bayesian inference. By repeatedly applying Bayes' Theorem, the posterior from one observation becomes the prior for the next.
The Base Rate Fallacy
A common human cognitive error is ignoring the base rate (the prior probability) when presented with specific evidence. For instance, if a disease is extremely rare (low base rate), even a highly accurate test will yield many false positives relative to true positives. Bayes' Theorem mathematically protects against this fallacy by explicitly requiring the prior probability P(A) in its calculation.
Sensitivity and Specificity
In medical testing and classification problems, two key metrics describe a test's performance. Sensitivity (or True Positive Rate) is P(B|A): the probability the test is positive given the condition is present. Specificity (or True Negative Rate) is P(¬B|¬A): the probability the test is negative given the condition is absent. The False Positive Rate, P(B|¬A), is exactly 1 minus the Specificity.
Historical Context
Bayes' Theorem is named after the Reverend Thomas Bayes (c. 1701–1761), an English statistician and philosopher who first formulated a specific case of the theorem. His work was published posthumously in 1763 by his friend Richard Price in an essay titled "An Essay towards solving a Problem in the Doctrine of Chances."
However, the modern mathematical formulation of the theorem was largely developed independently by the French mathematician Pierre-Simon Laplace in 1774. Laplace pioneered the application of inverse probability (his term for Bayesian updating) to problems in celestial mechanics, medical statistics, and jurisprudence, establishing the foundation of modern Bayesian statistics.
Applications
- Medical Diagnostics: Interpreting test results by factoring in the prevalence of a disease. Even a 99% accurate test might yield a posterior probability of less than 10% if the disease affects only 1 in 10,000 people.
- Spam Filtering: The Naive Bayes classifier is a simple but highly effective algorithm that uses Bayes' Theorem to calculate the probability a message is spam given the presence of specific words.
- Machine Learning: Bayesian inference underpins many advanced machine learning models, including Bayesian Networks, Gaussian Processes, and Variational Autoencoders. It allows models to express uncertainty in their predictions.
- Search and Rescue: The U.S. Coast Guard uses Bayesian search theory to locate lost vessels. They update a probability map of the vessel's location based on new evidence, such as negative search results in specific areas.
- Legal Proceedings: Quantifying the weight of forensic evidence. The "Prosecutor's Fallacy" is effectively a failure to apply Bayes' Theorem, mistakenly conflating P(Evidence|Guilt) with P(Guilt|Evidence).
Related Concepts
- Probability Distributions — How prior and posterior beliefs can be modeled continuously over parameters.
- Law of Large Numbers — How empirical frequencies converge to true probabilities over many trials.
- Monte Carlo Simulation — Computational methods often used to estimate complex posterior distributions (e.g., Markov Chain Monte Carlo).
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Bayes' Theorem module.
Try Bayes' Theorem on Riano →