The Bayesian Update
Every model you have fit so far answers with a single best number and a standard error. Bayesian modeling answers differently: every value the unknown could take gets a weight, and one fixed rule reshuffles those weights whenever new data arrives. This course builds that machinery from the ground up, and this lesson builds the rule itself.
Here is the situation the whole lesson lives in. Asha runs an online plant store. Her past checkout pages have converted about 10 percent of visitors into buyers. This morning she launched a redesigned page: 40 visitors so far, 8 purchases. That is 20 percent, double her history, on a sample small enough to be a fluke. What should she believe now?
By the end of this lesson you will be able to:
- Name the three pieces of every Bayesian update (the prior, the likelihood and the posterior) and say in words what each one measures
- Compute a posterior for a conversion rate in base R, no special packages needed
- Read a prior-likelihood-posterior chart and predict how it moves as data grows
- Report a posterior honestly: a point estimate, a 95 percent credible interval, and a direct probability statement
Prerequisites: you can work in R (vectors, plots), you know probability as a long-run fraction, and you have met the binomial setting: a count of successes in n independent tries.
The picture below is the whole lesson in one frame: a belief curve meets evidence and moves. Drag the sliders to see it happen, then we will build every piece by hand.
The prior: what you believed before the data
Start with the unknown itself. Call the true conversion rate of the new page \(\theta\) (the Greek letter theta): out of every 100 visitors who reach the page in the long run, \(\theta \times 100\) of them buy. It is one fixed number, and nobody knows it, not even Asha.
The Bayesian move is to describe that uncertainty with a curve. Lay out every value \(\theta\) could take, from 0 to 1, and give each one a height: high where the value is plausible, low where it is not. That curve, written \(p(\theta)\), is called the prior, because it captures what you believed prior to seeing the new data.
Asha is not starting from ignorance. Her records show a dozen past page designs converting between roughly 5 and 17 percent, typically near 10. So her prior should pile its weight around 0.10 and fade out by 0.20. R has a ready-made family of curves for values between 0 and 1, drawn by dbeta(). Its two shape numbers position the peak and set the width; the pair 8 and 72 puts the peak near 8 / (8 + 72) = 0.10 with the spread her records suggest. (Why this exact family is the natural choice is the subject of Lesson 2. For now it is simply a curve that matches her experience.)
Each lesson runs in a fresh interactive R session, so we build everything right here. Run this first:
Read the curve like a mountain of belief: the summit near 0.10 is the rate Asha finds most plausible, and 95 percent of her belief sits between 0.045 and 0.174. A rate of 0.30 is not impossible under this prior, just nearly weightless.