Why Mix a Binomial Model?
A binomial model assumes that the success probability is fixed for all trials in a group. That assumption can be unsuitable when groups differ in their underlying propensity for success. For example, patients treated at the same clinic may share conditions affecting their outcomes, or schools may differ in their underlying pass rates. A natural model lets each group have its own success probability, while describing how those probabilities vary across groups.
The beta-binomial distribution follows by combining two familiar ingredients: conditional on a group's probability, its success count is binomial; across groups, that probability follows a beta distribution. The derivation is an example of a mixture distribution: the marginal probability of a count averages the conditional binomial probability over the distribution of the latent probability.
The beta distribution has density on \(0<p<1\)
The positive parameters \(\alpha\) and \(\beta\) control the distribution of group probabilities. The conditional binomial mass at \(y\), for a given \(p\), is \(\binom{m}{y}p^y(1-p)^{m-y}\). Because the same \(P\) applies to every trial in a group, the marginal count is found by averaging this mass over the beta density.
Deriving the Beta-Binomial Mass
For any \(y\in\{0,\ldots,m\}\), the law of total probability for a continuous mixing variable gives
The last equality uses the definition of the beta function: the powers of \(p\) and \(1-p\) in the integral match its two arguments. This is the beta-binomial probability mass function.
For computation, the beta function can also be written as \(B(a,b)=\Gamma(a)\Gamma(b)/\Gamma(a+b)\) for \(a,b>0\), where \(\Gamma\) is the gamma function. When parameters are positive integers, this becomes \(B(a,b)=(a-1)!(b-1)!/(a+b-1)!\). Another useful notation is the rising factorial \((a)^{\overline{k}}=a(a+1)\cdots(a+k-1)\), with \((a)^{\overline{0}}=1\).
Worked Examples
Worked Example: A Count from a Beta(2, 3) Mixture
A group has \(m=4\) trials. Its success probability \(P\) has a beta distribution with \(\alpha=2\) and \(\beta=3\). Find the marginal probability of exactly two successes.
Use the mixture formula with \(y=2\):
All beta-function arguments here are positive integers. Thus
Therefore,
The answer is a marginal probability: it accounts for the fact that the group's success probability is not fixed at one value, but varies according to the beta distribution.
Worked Example: A Uniform Distribution of Group Probabilities
Suppose \(P\) is uniform on \((0,1)\), which is the beta distribution with \(\alpha=\beta=1\). For \(m=3\), find the probability of each possible count and check that the probabilities sum to one.
For each \(y=0,1,2,3\), the formula becomes
because \(B(1,1)=1\). Evaluate the four cases:
The total is \(1/4+1/4+1/4+1/4=1\), as required. In this case, every possible count has equal marginal probability. This is not the conditional binomial distribution at a particular \(p\); it results from averaging over all group probabilities with equal density.
Worked Example: Same Central Probability, Different Group Variation
Compare two-trial groups under \(P\sim\operatorname{Beta}(2,2)\) and \(P\sim\operatorname{Beta}(8,8)\). Both beta densities are symmetric about \(1/2\), but the second puts more probability near \(1/2\). Find the probability that both trials succeed in each model.
Conditional on \(P=p\), the probability of two successes is \(p^2\). Integrating over the mixing distribution gives
For \(\operatorname{Beta}(2,2)\), use \(B(a+1,b)/B(a,b)=a/(a+b)\), which follows directly from the gamma-function form of \(B\):
For \(\operatorname{Beta}(8,8)\), the same calculation gives
Thus the probabilities are \(3/10=0.30\) and \(9/34\approx0.265\), respectively. Although the mixing distributions are centered at the same value, the more dispersed group probabilities in the first model make extreme group outcomes, such as two successes, more likely. This comparison illustrates why the distribution of group probabilities matters; it is not a calculation of the beta-binomial variance.
What the Mixture Represents
The key modeling feature is that each group has one latent probability \(P\), shared across all its trials. If group \(j\) has probability \(P_j\), then conditional on \(P_j\), its count \(Y_j\) is binomial with \(m_j\) trials and success probability \(P_j\). Across groups, the \(P_j\) values can be modeled as draws from the same beta distribution. Integrating over \(P_j\) gives each group's beta-binomial count distribution.
Consequently, the mixture represents between-group probability variation, not a different fixed probability for every trial within a group. When a group's latent probability happens to be high, successes in that group are more likely together; when it is low, failures are more likely together. After \(P_j\) is integrated out, the trials in a group are generally not independent marginally, even though they are conditionally independent given \(P_j\). This shared latent probability is what permits the count distribution to differ from an ordinary binomial with one common fixed probability.
This interpretation is useful when grouped success counts show more variability across groups than a common-probability binomial model can represent. A beta-binomial model supplies a specific probability model for that heterogeneity. It is distinct from quasi-binomial modeling: the beta-binomial specifies a full marginal distribution for the counts, obtained from a stated mixing distribution.
Common Mistake: Mixing at the Wrong Level
A tempting but incorrect explanation is: “For each trial, independently draw a new probability from a beta distribution, then draw that trial's outcome; this gives a beta-binomial count.” That does not produce the beta-binomial mixture described here. If each trial gets an independent \(P_i\), then after integrating out each \(P_i\), the outcomes remain independent Bernoulli variables with the same marginal success probability. The group count is then binomial with that marginal probability.
For the beta-binomial, draw one \(P\) for the group, then conditionally generate all \(m\) trials using that same \(P\). The group-level probability is integrated out only after the conditional count probability is formed. The order and level of mixing are essential.
Check Your Understanding
Work through these questions to check your understanding of the mixture construction.
- Write the integral that gives \(P(Y=y)\) when \(Y\mid P=p\) is binomial with \(m\) trials and \(P\) has a beta distribution with parameters \(\alpha,\beta\).
- For \(m=2\), \(\alpha=1\), and \(\beta=2\), calculate \(P(Y=1)\) using the beta-function form.
- Why does the beta-binomial construction use the same latent probability for all trials in one group?
- Explain why independent beta-distributed probabilities for each trial do not give the same mixture as a single group-level beta-distributed probability.
- What feature of the model is represented by variation in the beta-distributed probabilities across groups?