frequentist vs bayesian
two ways to estimate a basketball player's free-throw rate ā change the inputs and watch both update
- frequentist (the textbook approach): give one best guess and a range. the range is not the probability the truth is inside it ā it's a procedure that, over many repeats, covers the truth 95% of the time.
- bayesian (the belief-updating approach): start with what you believed before, fold in what you saw, end with an updated belief curve. the 95% range really does mean "95% chance the truth is here, given what we believed and what we saw."
- change the inputs below and watch both methods react.
try a scenario
what you observed
made out of attempted ā 70.0% observed
what you believed before seeing the data
percent (1ā99)
2 = barely any opinion Ā· 200 = very confident
results
the textbook approach (frequentist)
(normal approximation) ā
(works at small n / extremes) ā
the range is not the probability the true rate is inside it. it's a procedure that, over many repeats, covers the truth 95% of the time.
the belief-updating approach (bayesian)
(posterior mean) ā
(posterior mode) ā
(2.5ā97.5% interval) ā
there is a 95% chance the true rate sits in the shaded band, given what you believed and what you saw.
picture
horizontal axis: true free-throw rate (0ā100%). the shaded band is the 95% credible interval. the whiskers under the axis are the two frequentist 95% ranges.
what changed
ā
ā
ā
method, formulas, references
The free-throw count is treated as a binomial outcome: k makes out of n attempts, with unknown success rate p. Both methods estimate p, but with different philosophies.
Frequentist. Best single guess is the sample proportion. Two 95% confidence intervals are shown:
pĢ = k / n Wald (textbook normal approx.): pĢ Ā± 1.96 Ā· ā( pĢ (1 ā pĢ) / n ) Wilson (small-n / extreme-rate safe): ( pĢ + z²/2n ± z Ā· ā( pĢ(1āpĢ)/n + z²/4n² ) ) / ( 1 + z²/n )
Wald is the formula in most introductory textbooks. It misbehaves at small n or when pĢ is near 0 or 1, sometimes producing endpoints outside [0, 1]. Wilson stays inside [0, 1] and has better coverage. Both are intervals on the procedure, not probability statements about p.
Bayesian. A Beta prior on p is conjugate to the binomial likelihood, so the posterior is also a Beta distribution with simple updates:
prior: p ~ Beta(αā, βā) likelihood: k ~ Binomial(n, p) posterior: p | data ~ Beta(αā + k, βā + n ā k) posterior mean = (αā + k) / (αā + βā + n) posterior mode = (α ā 1) / (α + β ā 2), when α, β > 1 95% credible interval = 2.5% and 97.5% quantiles of the posterior
The presets parameterise the prior as a mean μā and a "strength" Īŗā (interpretable as equivalent shots already seen): αā = μāĀ·Īŗā, βā = (1 ā μā)Ā·Īŗā. Uninformative is Beta(1, 1) (uniform on [0, 1]). The "vague" preset is μā = 0.75, Īŗā = 10; the "strong" preset is μā = 0.75, Īŗā = 80.
Posterior densities and quantiles are computed numerically on a 401-point grid in [0, 1] (no gamma function needed). The likelihood curve in the chart is rescaled to share the posterior's peak height ā this is a visual aid to compare shapes; the y-axis has no meaningful units.
References.
- Gelman, Carlin, Stern, Dunson, Vehtari, Rubin. Bayesian Data Analysis (3rd ed.), 2013 ā Beta-Binomial conjugacy, credible intervals.
- Brown, Cai & DasGupta (2001). "Interval Estimation for a Binomial Proportion." Statistical Science 16(2): 101ā133 ā why Wald fails and Wilson is preferred.
- Wilson, E. B. (1927). "Probable Inference, the Law of Succession, and Statistical Inference." JASA 22(158): 209ā212.