Why integrate over an event probability?
For a binary endpoint, a future event count is binomial if the probability of an event is fixed. In a Bayesian calculation, however, the event probability may itself have a probability distribution, such as a prior distribution or a posterior distribution updated with earlier data. Averaging the binomial model over that distribution gives a predictive distribution for the future count. This is useful for power calculations when the trial’s success rule can be expressed in terms of future counts.
The key modeling choice is that one unknown event probability is shared across the future observations, and uncertainty about that probability is represented by a beta distribution. Integrating over this shared probability induces dependence among the future binary outcomes. The resulting count distribution is beta-binomial, not binomial with the event probability simply replaced by its mean.
Here \(a\) and \(b\) are shape parameters, not observed event counts unless they arise from a particular prior and data update. A useful interpretation is that \(p\) is drawn from its beta distribution and then \(n\) outcomes are generated conditionally on that common \(p\). This is different from drawing a new event probability independently for every participant.
Deriving the predictive probability
The beta density is \(f(p)=p^{a-1}(1-p)^{b-1}/B(a,b)\) for \(0<p<1\), where \(B(a,b)=\int_0^1p^{a-1}(1-p)^{b-1}\,dp\) is the beta function. Conditional on \(p\), the binomial probability of \(Y=y\) is \(\binom{n}{y}p^y(1-p)^{n-y}\), for integer \(y=0,\ldots,n\). The marginal probability follows by integrating the conditional probability against the density of \(p\):
The last equality uses the definition of the beta function with updated arguments. Equivalently, using \(B(u,v)=\Gamma(u)\Gamma(v)/\Gamma(u+v)\), the probability mass function is
This formula is a probability mass function: its values are nonnegative and sum to one. The normalization can be checked directly by putting the integral expression back into the sum and interchanging a finite sum with an integral:
The bracketed sum is one by the binomial theorem. This also explains why a beta-binomial probability is not obtained by discarding the integration and substituting an average probability into each binomial mass.
Worked Example: Computing All Probabilities for Two Future Patients
Suppose the future event probability has distribution \(p\sim\operatorname{Beta}(2,3)\), and two future patients are observed, so \(n=2\). Find the predictive probabilities for zero, one, or two events.
First, \(B(2,3)=1/12\). For zero events, \(P(Y=0)=\binom{2}{0}B(2,5)/B(2,3)=(1/30)/(1/12)=0.4000\). For one event, \(P(Y=1)=\binom{2}{1}B(3,4)/B(2,3)=2(1/60)/(1/12)=0.4000\). For two events, \(P(Y=2)=\binom{2}{2}B(4,3)/B(2,3)=(1/60)/(1/12)=0.2000\).
The probabilities sum to \(0.4000+0.4000+0.2000=1.000\). In this example, the average event probability is \(a/(a+b)=2/5=0.4000\), and the predictive mean count is \(2(0.4000)=0.8000\). The full predictive distribution, however, is not the same as a binomial distribution with event probability 0.4000.
Predictive mean and variance
The mixture changes the variance as well as the shape of the count distribution. The moments follow from the conditional binomial moments and the law of total expectation and variance. Write \(\kappa=a+b\). For a beta-distributed event probability, \(E[p]=a/\kappa\), \(\operatorname{Var}(p)=ab/[\kappa^2(\kappa+1)]\), and \(E[p(1-p)]=ab/[\kappa(\kappa+1)]\). Since \(E[Y\mid p]=np\) and \(\operatorname{Var}(Y\mid p)=np(1-p)\), the predictive mean is
For the variance, the law of total variance gives the expected conditional variance plus the variance of the conditional mean:
A binomial distribution with the same mean event probability \(a/\kappa\) would have variance \(n(a/\kappa)(b/\kappa)=nab/\kappa^2\). Therefore, the ratio of beta-binomial variance to that binomial variance is \((\kappa+n)/(\kappa+1)\). For \(n>1\), the beta-binomial variance is larger when the beta distribution has nonzero variance. For \(n=1\), the ratio is exactly one: a single future outcome is Bernoulli with event probability \(a/\kappa\), so the two variances agree. This boundary case matters when describing the effect of mixing.
Worked Example: Comparing Predictive Variance With Binomial Variance
For the \(\operatorname{Beta}(2,3)\) model and \(n=2\), calculate the predictive variance and compare it with the variance of a binomial count using the mean event probability.
Here \(a=2\), \(b=3\), and \(\kappa=5\). The beta-binomial variance is \(\operatorname{Var}(Y)=2(2)(3)(5+2)/[5^2(5+1)]=84/150=0.5600\). A binomial count with probability \(2/5=0.4000\) has variance \(2(0.4000)(0.6000)=0.4800\). The ratio is \(0.5600/0.4800=7/6\), which agrees with \((\kappa+n)/(\kappa+1)=7/6\).
The larger predictive variance reflects uncertainty about the shared \(p\), not a change in the conditional binomial variance given \(p\). It does not mean that every particular tail probability must exceed the corresponding binomial tail probability.
Using the distribution in a power calculation
A trial’s decision rule defines which future outcomes count as success. If success occurs whenever the event count belongs to a set \(A\subseteq\{0,\ldots,n\}\), the predictive probability of success is the sum of the beta-binomial probabilities over that set:
For two independent groups with independent beta distributions for their event probabilities, the predictive joint probability of counts \(Y_T=y_T\) and \(Y_C=y_C\) is the product of their beta-binomial probabilities. The success probability is then a double sum over the pairs of counts satisfying the design’s success rule. If the group probabilities have a joint distribution that is not independent, the joint predictive probability must instead integrate over that joint distribution.
This calculation averages over the specified distribution for the event probability. If that distribution is a posterior updated with earlier data, the result is a posterior predictive success probability conditional on those data. If the event probability is held fixed at a specified value, the corresponding conditional calculation uses the binomial model instead. The interpretation of the power quantity depends on which distribution represents uncertainty in the design calculation; the beta-binomial formula supplies the predictive count probabilities, not the scientific decision rule. The earlier material on Bayesian power and assurance distinguishes the targets these calculations can represent.
Worked Example: Predictive Probability of at Least One Event
Suppose \(p\sim\operatorname{Beta}(2,8)\) and \(n=4\). Treat observing at least one event as the success condition. Compute the predictive success probability.
The complement is zero events, so \(P(Y\geq1)=1-P(Y=0)=1-B(2,12)/B(2,8)\). Since \(B(2,b)=1/[b(b+1)]\), \(B(2,12)=1/156\) and \(B(2,8)=1/72\). Thus \(P(Y=0)=(1/156)/(1/72)=72/156=6/13\), and \(P(Y\geq1)=1-6/13=7/13=0.5385\).
For comparison, replacing \(p\) by its mean \(2/(2+8)=0.2000\) gives a fixed-probability binomial calculation of \(1-(1-0.2000)^4=0.5904\). That is a different calculation: it conditions on one probability equal to the mean rather than averaging over the stipulated beta distribution. The predictive success probability under the beta model is 0.5385.
Assumptions, diagnostics, and alternatives
The beta-binomial calculation is exact under its model assumptions. The event probability lies between zero and one and has the specified \(\operatorname{Beta}(a,b)\) distribution; conditional on that probability, future outcomes are independent Bernoulli observations with the same \(p\); and the count is taken over a fixed number \(n\) of observations. In a posterior predictive calculation, the beta parameters must represent the intended posterior distribution for the event probability. For example, with a \(\operatorname{Beta}(a_0,b_0)\) prior and \(x\) events among \(m\) earlier observations, the beta-binomial update gives \(p\mid\text{data}\sim\operatorname{Beta}(a_0+x,b_0+m-x)\), which can be used for the future count.
Check whether a common event probability and conditional independence are credible for the future observations. Different risks across sites or patients, changes over calendar time, or clustering not captured by a shared probability may make the assumed model inadequate. Also check that the beta distribution is a defensible representation of uncertainty: its mean and concentration \(\kappa=a+b\) determine both the center and spread of the predictive count. Compare predictive probabilities under scientifically plausible parameter choices, and, when possible, compare the analytic probabilities with a simulation that draws \(p\) and then draws \(Y\mid p\). A mismatch between the two calculations can reveal an implementation error; agreement alone does not establish that the model assumptions are appropriate.
The binomial model is the main alternative when \(p\) is treated as fixed for the operating-characteristic calculation. It is simpler and gives a different target when the beta distribution represents genuine uncertainty. For a beta mixing distribution and a common conditional probability, the beta-binomial gives an exact finite-sample predictive law without numerical integration or simulation. For a different mixing distribution or a more complicated dependence structure, numerical integration or simulation may be needed instead; the beta-binomial formula should not be used merely because outcomes are binary.
Common mistakes
- Plugging in the mean event probability. A binomial distribution with \(p=a/(a+b)\) does not generally reproduce the beta-binomial predictive probabilities. It omits uncertainty in \(p\).
- Forgetting the binomial coefficient. The factor \(\binom{n}{y}\) is part of the probability of a count, and omitting it usually prevents the probabilities from summing to one.
- Mixing up conditional and predictive calculations. The binomial model describes \(Y\) conditional on a fixed \(p\); the beta-binomial describes \(Y\) after averaging over a distribution for \(p\).
- Claiming greater variance for every sample size. The beta-binomial variance exceeds the same-mean binomial variance when \(n>1\) and \(p\) is uncertain. When \(n=1\), the variances are equal.
- Assuming the model handles all heterogeneity. A shared random event probability induces dependence, but it does not automatically represent time trends, multiple risk groups, or arbitrary clustering.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- For \(p\sim\operatorname{Beta}(1,1)\) and \(n=2\), find \(P(Y=0)\) using the beta-binomial formula.
- For \(p\sim\operatorname{Beta}(2,8)\) and \(n=2\), find \(P(Y=2)\).
- Why do the beta-binomial and same-mean binomial variances agree when \(n=1\)?
- For \(p\sim\operatorname{Beta}(1,1)\) and \(n=3\), find the predictive probability of at least two events.
Solutions. (1) \(P(Y=0)=B(1,3)/B(1,1)=1/3=0.3333\). (2) \(P(Y=2)=B(4,8)/B(2,8)=(2\cdot3)/(10\cdot11)=3/55=0.05455\). (3) With one observation, \(Y\) is Bernoulli after mixing, with event probability \(E[p]\); its variance is \(E[p]\{1-E[p]\}\), the same as the Bernoulli variance at the mean probability. Equivalently, the variance ratio \((a+b+n)/(a+b+1)\) is one when \(n=1\). (4) For \(\operatorname{Beta}(1,1)\) and \(n=3\), the beta-binomial formula gives probability \(1/4\) for each count \(0,1,2,3\). Therefore \(P(Y\geq2)=1/4+1/4=1/2\).