Stats 401 - Week 8 - Bayesian Basics - Beta-Binomial
Overview
Miles Chen develops the beta-binomial model as a practical way to combine prior knowledge with binomial data, showing that a Beta(α, β) prior updated by z successes in n trials produces a Beta(α + z, β + n − z) posterior. A baseball example uses a prior mean of 0.27 and concentration 300, then connects posterior estimates and shrinkage to credible intervals, prediction, and Monte Carlo integration.
Key takeaways
- A Beta(α, β) prior updated with z successes and n − z failures yields Beta(α + z, β + n − z), so Bayesian updating amounts to adding observed counts to prior pseudo-counts.
- For the baseball example, Beta(81, 219) encodes a prior mean of 0.27 and concentration 300; after five hits and five outs, the posterior is Beta(86, 224) with mean about 0.277.
- Posterior shrinkage is governed by the relative information in prior concentration and sample size: small samples stay near the prior mean, while large samples pull estimates toward the observed proportion.
- A 95% Bayesian credible interval describes posterior probability for the parameter, while equal-tail and highest-density intervals allocate probability differently when the posterior is skewed.
- When predicting multiple future outcomes under uncertainty about θ, average the outcome probability over the posterior; plugging in a single estimate can be noticeably inaccurate for a wide posterior.
- Monte Carlo prediction approximates posterior expectations by sampling parameter values and averaging outcome functions, matching the analytic Beta-function calculation in the baseball example.
Chapters
- The Beta(α, β) mean is α divided by α + β.
- For α and β greater than 1, the mode is (α − 1) divided by (α + β − 2).
- Mean and mode provide alternative ways to describe the location of a Beta distribution.
- A flat Beta(1, 1) prior represents any blue-marble proportion θ between 0 and 1 as initially equally plausible.
- Six blue marbles and four non-blue marbles give a likelihood proportional to θ⁶(1 − θ)⁴.
- The posterior is Beta(7, 5), with mode 0.6 and mean about 0.583; the observed non-blue marbles make θ = 1 implausible.
- Batting average is hits divided by at-bats, and the lecture contrasts roughly 0.20 for a poor average with 0.30 for a good one.
- A rookie who gets five hits in 10 at-bats has a maximum-likelihood estimate of 0.50, but that small sample is not persuasive evidence of a sustainable rate.
- The all-time Major League career batting-average record cited is 0.372, illustrating why plausible long-term rates are far below 0.50.
- Chen chooses a prior mean of 0.27 to represent a typical Major League batting average.
- A concentration of 300 gives Beta shape parameters α = 81 and β = 219, equivalent to 81 prior hits and 219 prior outs.
- The prior places most probability around batting averages from approximately 0.22 to 0.32 and makes rates above 0.35 rare.
- For five hits and five outs in 10 at-bats, the likelihood kernel is θ⁵(1 − θ)⁵; the binomial coefficient does not depend on θ.
- Multiplying the likelihood by the Beta(81, 219) prior adds the exponents, producing a posterior kernel proportional to θ⁸⁵(1 − θ)²²³.
- The normalized posterior is Beta(86, 224), formed by adding five observed hits and five observed outs to the prior counts.
- With a Beta(α, β) prior and z successes among n binomial trials, the posterior is Beta(α + z, β + n − z).
- The Beta prior is conjugate to the binomial likelihood because the posterior remains in the Beta family.
- Other conjugate pairs mentioned include Gamma with Poisson data and Normal with a Normal likelihood.
- Posterior mean and mode can be calculated directly from the updated Beta shape parameters, while the median generally requires an inverse CDF or quantile function.
- For Beta(86, 224), the mean is about 0.277 and the mode is about 0.276.
- Chen uses an interactive Beta-binomial page to compare the prior, likelihood, and posterior for different hit counts and prior settings.
- The posterior mean is a weighted average of the prior mean and the observed sample proportion, with prior concentration and trial count controlling their influence.
- A 0.50 rate over 10 at-bats shifts the prior only slightly, while a sustained 0.50 rate over many more at-bats shifts the posterior much further.
- A higher prior concentration resists small samples more strongly; a lower concentration lets the likelihood pull the posterior farther.
- The prior can be understood as pseudo-trials: the baseball prior represents 300 at-bats with 81 hits before the rookie's data are observed.
- For the Beta(86, 224) rookie posterior, the probability that θ exceeds 0.30 is about 18.6%.
- A 95% credible interval is interpreted in the Bayesian framework as assigning 95% posterior probability to the parameter being inside the interval.
- An equal-tail interval leaves 2.5% probability in each tail; a highest-density interval includes the most probable parameter values.
- For skewed or multimodal distributions, highest-density regions can differ from equal-tail intervals and may consist of disjoint intervals.
- The posterior mean, about 0.277 for Beta(86, 224), gives the predictive probability of a hit on the next at-bat.
- Predicting exactly two hits in three at-bats requires averaging 3θ²(1 − θ) over uncertainty in θ, rather than assuming θ is known.
- Plugging in the posterior mean or mode is a convenient approximation, but it can differ from a full posterior predictive calculation.
- Bag A has a fixed half-blue composition, so two draws with replacement are both blue with probability 1/4.
- Bag B is either entirely blue or entirely white, each with probability 1/2; two draws are both blue with probability 1/2.
- Both bags give a 1/2 chance of blue on one draw, but uncertainty about the bag's composition changes the probability of multiple outcomes.
- When θ is uncertain, learning from one draw changes beliefs about θ and therefore affects predictions for later draws.
- The probability of exactly two hits in three at-bats is computed by integrating 3θ²(1 − θ) against the Beta(86, 224) posterior density.
- The integral reduces to a ratio of Beta functions, yielding an exact predictive probability of approximately 0.16715.
- For a wider Beta(7, 5) distribution, the exact predictive probability is about 0.385, compared with about 0.432 from plugging in a point estimate.
- Monte Carlo prediction draws many θ values from the posterior Beta distribution, evaluates the desired outcome function for each draw, and averages the results.
- Chen describes generating one million draws from Beta(86, 224) and applying 3θ²(1 − θ) to estimate the probability of exactly two hits in three at-bats.
- The simulation closely matches the analytic result of about 0.16715 without requiring a hand-worked integral.
- With seven successes in 10 trials, a Beta(1, 1) prior gives a Beta(8, 4) posterior with mean 0.667 and mode 0.70.
- A stronger symmetric Beta(5, 5) prior gives Beta(12, 8), with mean 0.60 and mode about 0.611, pulling estimates toward 0.50.
- For click data with 150 clicks in 1,000 visits, processing weeks in either order produces the same final Beta posterior because only total counts matter.
- For a right-skewed posterior, the highest-density interval can include unequal tail areas; equal-tail and highest-density intervals become similar as distributions become more symmetric.
- The closing example introduces a Normal prior for a mean paired with a Normal likelihood.
- Chen says the next week will develop Monte Carlo methods for estimating Bayesian quantities.
- The lecture concludes with the broader idea that conjugate models simplify updates, while simulation can handle posterior calculations that are difficult to integrate directly.
Transcript excerpt
0:03 All right. So this is okay. I don't know if I want to go through the derivation of the mean and stuff. But basically we can say, all right, if this is the PDF of the mean we you would multiply the PDF by that the random variable theta here. And then, and that basically, that adds a one to the numerator I mean, the not numerator exponent of alpha plus one. And, and see, get this beta of alpha plus one over beta, beta divided by beta alpha one, and then you expand that using the definition of the beta function and the gamma function, because gamma function is basically the factorial, the gamma function of
0:54 what do you call it? Gamma of you know some value alpha plus one is alpha times gamma of alpha and things like that. So anyway, this multiplies out and you can calculate all this and you end up getting the the mean is alpha divided by alpha plus beta which which we showed, okay? And then as far as the mode goes, you take the PDF of your values, okay? And then what you do is you take the derivative of it, okay? Derivative with with respect to theta, okay? And then you set it equal to zero and you solve and, and this will result in this being the the peak the location peak alpha minus
1:43 one divided by alpha plus beta minus two, okay? And that just gives you like an alternative parameterization of this, and so you can specify your shape parameters beta and you know, shape parameter alpha beta and you can also get you know calculate the the mode or the mean based on that. Okay? And the relationship between alpha and beta and the the mode and the mean
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Miles Chen.