Why Boundary Counts Need Care
In a small basket, observing no responses or observing a response for every participant is possible even when the underlying response probability is not exactly zero or one. The raw proportion is then at a boundary: zero responses gives an observed rate of 0, and all responses gives an observed rate of 1. Those proportions describe the data, but they can be unstable estimates of the basket’s response probability, particularly when the sample is small.
A beta-binomial hierarchy can temper these extreme estimates by relating basket-specific response probabilities through a shared distribution. The amount and direction of that adjustment depend on the model’s assumptions and on information from other baskets. The calculation is not a rule that replaces a zero or one with a fixed correction; it follows from the prior distribution and the observed counts.
Model and Posterior at the Boundaries
This model assumes that participants within a basket have a common response probability and that the binomial sampling model is appropriate. Conditional on fixed \(\alpha,\beta\), the baskets share a prior distribution, not a single response probability. Thus, the model allows basket rates to differ. If \(\alpha,\beta\) are unknown, a hyperprior is required; data from other baskets can then inform them, and uncertainty about them should be carried into the target basket’s posterior.
For a basket with \(y_j\) responses, multiplying the binomial likelihood by the beta prior gives the conjugate posterior \(p_j\mid y_j,\alpha,\beta\sim\operatorname{Beta}(\alpha+y_j,\beta+n_j-y_j)\). Its posterior mean is the posterior estimate of the response probability under squared-error loss.
The last expression shows the weight structure: the prior mean receives weight \(s/(s+n_j)\), while the observed rate receives weight \(n_j/(s+n_j)\). At either boundary, this gives a finite posterior mean as long as \(\alpha\) and \(\beta\) are positive:
These are conditional results: they use specified values of \(\alpha,\beta\). If those parameters are estimated from other baskets, the estimate for basket \(j\) may move as the other baskets inform the shared distribution. If they are uncertain, the posterior mean must average over that uncertainty as well.
Worked Boundary-Count Calculations
Worked Example: Zero Responses in a Small Basket
Suppose a hypothetical basket has \(n_j=8\) participants and \(y_j=0\) responses. For illustration, condition on a \(\operatorname{Beta}(2,3)\) prior. Its mean is \(2/(2+3)=0.4\), and its concentration is \(s=5\).
The posterior distribution is \(\operatorname{Beta}(2+0,3+8)=\operatorname{Beta}(2,11)\). Therefore,
The observed response rate is 0/8, or 0%, but the posterior mean is 15.38%. This estimate is pulled toward the prior mean of 40%; the eight participants still have substantial influence, so the posterior mean is far below 40%. The result does not claim that a response occurred in this basket. It estimates the underlying response probability under the stated model and prior.
Worked Example: Responses for Every Participant
Now suppose a different hypothetical basket has \(n_j=6\) participants, all of whom respond, so \(y_j=6\). Use the same \(\operatorname{Beta}(2,3)\) prior, with mean 0.4 and concentration 5.
The posterior is \(\operatorname{Beta}(2+6,3+0)=\operatorname{Beta}(8,3)\), and its mean is
The raw response rate is 6/6, or 100%, while the posterior mean is 72.73%. The estimate is below 1 because the prior assigns positive probability to response probabilities below 1. The posterior remains compatible with a high response probability; the posterior mean simply avoids treating six responses as proof that the underlying probability is exactly one.
What “Borrowing” Means When Hyperparameters Are Uncertain
With fixed \(\alpha,\beta\), the posterior calculation for one basket uses its own count and the specified shared prior. The other baskets do not directly appear in that conditional formula. In a fully Bayesian hierarchy, however, the other baskets contribute information about the shared hyperparameters. The target basket’s posterior is then a mixture of beta posteriors over the posterior distribution of \(\alpha,\beta\).
Here \(\mathbf{y}\) denotes the counts from all baskets, and \(\pi(\alpha,\beta\mid\mathbf{y})\) is the posterior distribution of the shared hyperparameters. The target basket’s count also updates that distribution. Consequently, one cannot generally calculate the fully Bayesian answer by estimating \(\alpha,\beta\) from the other baskets alone and then treating those estimates as known. That plug-in calculation can be a useful approximation, but it omits hyperparameter uncertainty.
Worked Example: A Zero-Response Basket Updates Shared Hyperparameter Weights
Consider a hypothetical two-component model for the shared prior, with concentration \(s=5\). After observing other baskets, suppose the posterior probability is 0.75 for a prior \(\operatorname{Beta}(1,4)\) and 0.25 for a prior \(\operatorname{Beta}(3,2)\). The corresponding prior means are 0.2 and 0.6. Now observe a target basket with \(n_j=4\) and \(y_j=0\). The target count must update the component probabilities.
Under \(\operatorname{Beta}(1,4)\), the probability of zero responses in four participants is
Under \(\operatorname{Beta}(3,2)\), that probability is
Weighting these likelihoods by the probabilities from the other baskets gives unnormalized weights \(0.75(1/2)=0.375\) and \(0.25(1/14)=0.017857\). After normalization, the component probabilities are \(21/22=0.9545\) and \(1/22=0.04545\). The zero count makes the lower-mean component more plausible.
The conditional posterior means for the target basket are \(1/(5+4)=1/9\) under the first component and \(3/(5+4)=1/3\) under the second. Averaging with the updated weights gives
This example isolates two parts of borrowing: information from other baskets sets the pre-target component weights, and the target’s zero count updates those weights as well as its conditional posterior. A different hyperprior or different data from other baskets could produce a different estimate.
Derivation and the Boundary Likelihood
The posterior calculation follows directly from the likelihood. For observed count \(y_j\), the likelihood as a function of \(p_j\) is proportional to \(p_j^{y_j}(1-p_j)^{n_j-y_j}\). Multiplying by the beta density, proportional to \(p_j^{\alpha-1}(1-p_j)^{\beta-1}\), adds the exponents:
These are the exponents of a \(\operatorname{Beta}(\alpha+y_j,\beta+n_j-y_j)\) density. At zero responses, the likelihood is proportional to \((1-p_j)^{n_j}\); at all responses, it is proportional to \(p_j^{n_j}\). Each likelihood favors a boundary, but a proper beta prior with positive parameters yields a proper posterior with finite parameters. For a zero count, the posterior has positive first shape parameter \(\alpha\); for an all-response count, it has positive second shape parameter \(\beta\).
The beta-binomial marginal likelihood also makes explicit how a basket informs the shared parameters:
For zero responses this reduces to \(B(\alpha,\beta+n_j)/B(\alpha,\beta)\); for all responses it is \(B(\alpha+n_j,\beta)/B(\alpha,\beta)\). These probabilities enter the posterior update of the hyperparameters. They do not mean that every basket’s observed responses are simply pooled into one binomial count.
Comparisons, Diagnostics, and Limitations
| Approach | Boundary-count behavior | Main trade-off |
|---|---|---|
| Independent basket with a beta prior | A zero or all-response count yields a finite posterior mean. | No learning across baskets unless the prior itself is externally informed. |
| Beta-binomial hierarchy | Produces finite basket-specific estimates and can adapt the shared distribution using all basket data. | Results depend on the exchangeability assumption and hyperprior; sparse data can leave hyperparameters uncertain. |
| Complete pooling | Uses a common response rate, so an individual basket’s estimate is the pooled rate. | Can conceal genuine differences between baskets by assuming there is no basket-level variation. |
The hierarchy is most useful when partial sharing is clinically and statistically defensible: baskets are sufficiently comparable to inform a shared distribution, but their response probabilities need not be identical. Exchangeability is an assumption about the model’s treatment of baskets, not a guarantee that their biology or treatment effects are the same.
A few checks help identify fragile boundary estimates. First, inspect the posterior distribution, not only its mean: at small sample sizes, uncertainty may remain wide even when the mean is pulled away from zero or one. Second, examine how the estimate changes under plausible hyperprior choices and under an analysis with little or no borrowing. A large change signals that conclusions rely strongly on the sharing assumptions. Third, check whether the shared distribution is plausible in light of the basket-level response patterns. If baskets show patterns inconsistent with a common distribution, borrowing may be misleading. Finally, distinguish the conditional posterior at fixed hyperparameters from the fully Bayesian posterior that integrates their uncertainty.
A frequent mistake is to say, “This basket had zero responses, so its response probability is zero,” or, conversely, “The prior prevents zero, so the basket must have a positive response rate.” The first statement confuses a sample proportion with an unknown probability; the second treats a prior assumption as observed evidence. The correction is to report the observed count and rate, then describe the posterior estimate and uncertainty under the stated model. A posterior mean above zero does not establish that responses will occur, and borrowing does not remove the need to assess model fit and clinical relevance.
Check Your Understanding
Answer each question using the stated model. Short solutions follow the questions.
- A hypothetical basket has \(n_j=5\), \(y_j=0\), and a \(\operatorname{Beta}(1,1)\) prior. What is the posterior distribution and posterior mean?
- With a \(\operatorname{Beta}(2,2)\) prior, what is the posterior mean for a basket with \(n_j=4\) and \(y_j=4\)?
- For a fixed \(\operatorname{Beta}(\alpha,\beta)\) prior, explain why the posterior mean for a zero-response basket is positive when \(\alpha>0\).
- Why might a fully Bayesian estimate differ from a calculation that fixes \(\alpha,\beta\) at estimates obtained from other baskets?
- What assumption is made by complete pooling that differs from the beta-binomial hierarchy?
Solutions. 1. The posterior is \(\operatorname{Beta}(1,6)\), with mean \(1/(1+6)=1/7=0.1429\). 2. The posterior is \(\operatorname{Beta}(6,2)\), with mean \(6/(6+2)=0.75\). 3. The mean is \(\alpha/(\alpha+\beta+n_j)\); its numerator is positive and its denominator is positive, so the mean is positive. 4. The fully Bayesian calculation averages over the posterior distribution of \(\alpha,\beta\), including its uncertainty; fixing them at estimates omits that uncertainty and may also fail to account for the target basket’s contribution to their posterior. 5. Complete pooling assumes all baskets share one response probability, whereas the hierarchy allows basket-specific probabilities drawn from a shared distribution.