Bayesian Inference: Updating Beliefs with Data
Bayesian inference formalizes learning from experience, updating your belief in a hypothesis as you gather evidence. It's used in A/B testing and medical diagnostics. The footgun is that a poor initial belief (the prior) can skew your conclusions.
THE MENTAL MODEL: Bayesian inference is a mathematical way to update your beliefs in the face of new evidence. Instead of determining a single, objective truth, it adjusts your confidence in a hypothesis. It combines what you already believe (the prior) with what you just observed (the likelihood) to form a new, updated belief (the posterior). It's the formal process of changing your mind.
HOW IT WORKS: The process uses Bayes' theorem to calculate an updated probability. It starts with a 'prior probability,' which is your initial assessment of a hypothesis's likelihood before seeing new data. Then, you consider the 'likelihood,' which is the probability of observing the new data if your hypothesis were true. Combining the prior and the likelihood gives you the 'posterior probability' — your revised belief. This process is iterative; as more data arrives, today's posterior becomes tomorrow's prior, continuously refining your understanding. This is known as Bayesian updating.
WHEN TO USE IT: Bayesian inference is powerful when you have limited data but strong domain knowledge that can inform a reasonable prior. It excels in online systems that must adapt in real-time, like spam filters learning from user reports or recommendation engines updating user preferences. It's also ideal for situations where you need a full probability distribution of outcomes, not just a single point estimate, such as stating there's a 95% chance version A is better than version B in an A/B test.
WHEN NOT TO USE IT: Avoid it when you have no objective basis for choosing a prior, as a poorly chosen one can heavily bias the results, especially with small datasets. For massive datasets, simpler frequentist methods are often computationally cheaper and converge to similar results, as the influence of the prior diminishes with more data. If the complexity of calculating a full probability distribution is overkill for your problem, a simpler method may be better.
ONE CANONICAL EXAMPLE: Consider diagnosing a rare disease that affects 1 in 10,000 people. Your prior belief that a random person has the disease is 0.01%. Now, a patient tests positive on a test that is 99% accurate (1% false positive rate). A naive interpretation might be that the patient has a 99% chance of having the disease. However, Bayesian inference combines the low prior probability with the test result. The posterior probability will be significantly higher than 0.01%, but still only around 1%, because the high number of healthy people getting false positives outweighs the small number of sick people getting true positives. Your belief is updated, but grounded by the initial rarity.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.