From prior to posterior
What do you believe about a drug's true response rate before the trial data, and after?
You know nothing about this new drug, so every true response rate starts equally likely.
A drug's true response rate is the share of patients it helps: 0.5 means half. Your prior is your belief before the trial; the posterior is your belief after.
1. Prior: what you believe
Flat: every true response rate starts equally believable. Or drag the orange bars.
2. Data: add patients
3. Combine
Hover or tap a bar to see the arithmetic.
Textbook example: 100 patients instead of 10. Same bell-shaped start, narrower belief.
Prior
Posterior for 10 patients
Posterior for 100 patients
Predict, then check
A shortcut: one smooth curve
Bars work, but they are clumsy: one multiplication per bar. A smooth curve does the same job with two numbers.
One specific sequence
Four patients: R = responded, N = did not.
\[\theta\times\theta\times(1-\theta)\times\theta=\theta^{3}(1-\theta)\]
Any one sequence with \(h\) responders and \(t\) non-responders has chance \(\theta^{h}(1-\theta)^{t}\), whatever the order.
How many sequences have h responders?
List them all. Pick the number of patients and the number of responders.
The count is called "n choose h", written \(\binom{n}{h}\). It is the number of rows in the list.
Optional: counting orderings
Count without listing (\(t=n-h\)):
\[\binom{n}{h}=\frac{n!}{h!\,t!}\]
Put together: the binomial
Chance of \(h\) responders in \(n\) patients:
\[\binom{n}{h}\,\theta^{h}(1-\theta)^{t}\]
The count does not depend on θ, so it only scales the curve and never changes its shape. That is why the fit curve (and, from a flat prior, the posterior) is just \(\theta^{h}(1-\theta)^{t}\).
Bars and formula agree
Its name
Start from no idea (flat bars): after \(h\) responders and \(t\) non-responders the posterior has exactly this shape, called a Beta curve, Beta(\(h+1\), \(t+1\)). Beta(a, b) = as if you had already seen a − 1 responders and b − 1 non-responders. Beta(1, 1) = no patients yet. The best guess, the average of the curve, is a/(a + b).
Each curve's height shows how believable each true response rate is. The orange tick marks the best guess a/(a + b).
The shortcut
Beta(a, b), then \(h\) responders and \(t\) non-responders, gives \[\mathrm{Beta}(a+h,\; b+t)\]
Book chapter 3. Try it: set the prior, then add patients.
Prior Beta(a, b)
Data
Predict, then check
A real small trial: ECMO
ECMO is a machine that adds oxygen to a sick newborn's blood. All 11 newborns on it survived (press "Newborn trial (real)" above).
Standard care had 0 of 1 survive. With flat priors for both arms, how likely is it that ECMO truly saves more newborns?
Same data: ECMO 11 of 11, standard care 0 of 1, flat priors, simulated from the two posteriors. One baby on standard care is very little to compare with. Source: Bartlett et al. (1985), Pediatrics.
Regulator's corner
Bayesian means prior plus data, as on this page. FDA draft advice (January 2026):
"It is always critical for Bayesian analyses to have a prespecified prior…"
Section IV.B. FDA draft guidance, Use of Bayesian Methodology in Clinical Trials of Drug and Biological Products. In a trial: choose the prior before treating anyone.
Takeaway
- Posterior = prior × likelihood, rescaled to add to 1.
- More data: narrower peak, and the prior matters less.
- A Beta curve is a shortcut for the bars: Beta(a, b) plus h responders and t non-responders is Beta(a + h, b + t).