Beta-Binomial Distribution
A discrete random variable follows the Beta-Binomial distribution with trials and shape parameters , , defined by the probability mass function
where is the Beta function.The Beta-Binomial distribution is a compound distribution: it arises from a Binomial experiment in which the success probability is not fixed, but is itself a random variable drawn from a prior. Formally, if
then the marginal distribution of (obtained by integrating out ) is . This can be verified by computing
A key characteristic of the Beta-Binomial is overdispersion: because the success probability varies across trials (in the sense that it is drawn once from a Beta and then held fixed), the variance of exceeds that of a Binomial with the same mean. This makes the Beta-Binomial appropriate whenever count data exhibits more variability than the Binomial alone can explain.
Special cases:
If , the success probability is , and for all —a discrete uniform over .
As with held constant, the Beta prior concentrates at and .
Exchangeability, not Independence underlying Bernoulli trials are exchangeable but not independent. Conditional on they are i.i.d., but marginally (after integrating out ) they are positively correlated: observing a success makes the next trial more likely to succeed, because it shifts the posterior of upward. This is a manifestation of Bayes' rule in action.
In the Beta-Binomial model, the
Intuition
The Beta-Binomial answers a natural question: what happens when you run a Binomial experiment but don’t know the true success probability? In a standard Binomial, is fixed and known—every trial has the same chance of success. But in many real situations, is uncertain or varies across groups. The Beta-Binomial handles this by placing a Beta prior on and averaging over all possible values.
Think of it as a two-stage process. First, nature draws a success probability from . Then, Bernoulli trials are conducted with that . Because is random, the resulting count has more spread than a plain Binomial—sometimes is high and you see many successes, sometimes it is low and you see few. This extra variability is what makes the Beta-Binomial useful for modeling heterogeneous populations, where different subgroups may have different underlying rates.
Properties
(Mean) .
This is the same as , which follows from the law of iterated expectation: .
(Variance) .
By the law of total variance, . The first term gives the average within-group binomial variance; the second captures the between-group variability due to the random . The result can be rewritten as
where is the intraclass correlation. Since , the variance always exceeds the Binomial variance .
(Overdispersion Factor) The ratio for , confirming that the Beta-Binomial is overdispersed relative to the Binomial.
(Binomial Limit) As with fixed, the Beta prior concentrates at , , and .
(Symmetry) satisfies if and only if , mirroring the symmetry of the prior about .
(Marginal Likelihood) In Bayesian inference, the normalizing constant of the posterior is exactly the Beta-Binomial PMF. That is, serves as the marginal likelihood (or evidence) used for Bayesian model comparison.
Examples
Defective Items Across Factories
A company operates many factories, each producing items per batch. The defect rate varies from factory to factory according to , so that the average defect rate is . Let be the number of defective items in a randomly chosen batch.
What is the distribution of , and how does its variance compare to a Binomial with ? Since and , we have . The mean is which matches . However, the variance is while . The Beta-Binomial variance is nearly twice as large, reflecting the factory-to-factory heterogeneity in defect rates. The overdispersion factor is .
Bayesian Prediction
You are estimating the probability that a website visitor clicks a particular ad. Your prior is , reflecting a belief that the click-through rate is around . You observe visitors and clicks.
What is the posterior distribution of , and what is the predictive probability that the next visitor clicks? By Beta-Bernoulli conjugacy, the posterior is The posterior mean is , pulled from the prior mean of toward the observed rate of by the weight of the data.
The posterior predictive probability that the next visitor clicks is simply the posterior mean of :
More generally, the predictive distribution for new successes in future trials is , which is the Beta-Binomial with the updated posterior parameters.