Bayesian inference: updating beliefs with data
Everything so far was the frequentist approach: the true value is considered fixed, and we ask "how surprising is the data if the hypothesis is true". The Bayesian approach looks differently: our knowledge of a quantity is a distribution of confidence, which the data UPDATES. Move the prior belief and the data β watch the posterior get born.
ΞΈ is the unknown true share (say, a buttonβs conversion). The gray curve is what you believe BEFORE the data (the prior); its center is set by "Prior belief" and its width by "Prior strength" (more strength β narrower and more confident). The yellow dashed one is what the data ALONE says (k successes out of n): its peak sits at the share k/n. The blue one is the result (the posterior): it comes from multiplying the gray and the yellow and always lies BETWEEN them. Move the sliders: with little data the result leans toward the prior; at large n the yellow curve gets narrow and pulls the result toward itself β the data "overrides" the initial belief.
The gray curve is the prior distribution: what we believe about the share ΞΈ (say, a conversion rate) BEFORE the experiment. It is not one number but a whole distribution of plausibility over values. Put the prior mean where you expect the conversion, and set the "prior strength" to how confident you are.
The Bayesian approach works naturally with small data: instead of "too little to judge" it honestly shows a wide posterior β large uncertainty that narrows as observations accumulate.
In product A/B tests, Bayesian metrics ("probability that B beats A", "expected loss") are clearer to the business than a p-value. But the prior must be chosen thoughtfully: a strong biased prior with little data can drag the conclusion.
Spam filters are historically Bayesian: the prior probability of spam is updated by the email's words (naive Bayes). The same mechanism drives medical diagnostics, where the disease base rate is updated by a test result (we saw this in the conditional probability lesson).
Recommender and search systems, A/B platforms, demand forecasts increasingly use Bayesian updating: it elegantly merges accumulated experience with new data in real time.
Definitions
With little data the posterior almost entirely echoes the prior β the conclusion is exactly as honest as the prior. Check the sensitivity: does the answer change much under another reasonable prior?
"The probability that the effect exists" is a probability GIVEN your premises: the noise model and the prior. A crooked model or dependent data breaks Bayesian inference just as mercilessly as frequentist.
Deep dive: the math and the mechanism (optional)
The "sharpening" mechanism. The posterior at each point ΞΈ is the product of the prior and the likelihood: posterior(ΞΈ) β prior(ΞΈ)Β·L(data|ΞΈ). With many observations the likelihood L is a product of each observation's probabilities, so it peaks sharply near the ΞΈ that best explains the data. Multiplying a narrow likelihood by a wide prior gives a narrow posterior at that peak β that is why data "wins" and narrows the belief.
Why little data β the posterior stays near the prior: at small n the likelihood is still flat (the data rules out little), and the prior sets the shape. As n grows, the likelihood gets ever sharper and suppresses the prior β hence "data overrides preconceptions". Conjugate priors (Beta for shares, as in the widget) are convenient because the posterior stays in the same family β so the update reduces to a simple recalculation of the parameters.