Why Compare Enumeration and Simulation?
An interim predictive probability is a probability about what may happen among the patients still to be observed, conditional on the responses available now. With a binary response and a fixed number of future patients, the possible future response counts form a finite set. This makes exact calculation possible: evaluate the predictive probability at each count and add the probabilities for counts that meet the terminal success rule.
A second approach is Monte Carlo simulation: repeatedly draw a possible future outcome under the posterior predictive distribution and record whether it meets the rule. Simulation is useful when the event is complicated or exact summation is cumbersome, but its estimate has random error. That error matters when an interim decision depends on whether the predictive probability lies above or below a boundary.
Exact Enumeration Under the Beta-Binomial Model
Suppose the response probability \(p\) has a \(\mathrm{Beta}(a,b)\) prior. At an interim analysis, \(x\) responses have been observed among \(n\) patients. Under the model, patient responses are conditionally independent Bernoulli observations given \(p\). The posterior distribution is \(\mathrm{Beta}(A,B)\), where \(A=a+x\) and \(B=b+n-x\). If \(m\) patients remain, let \(Y\) be their total number of responses. The posterior predictive probability of \(Y=y\) is beta-binomial:
Here \(\mathrm{B}(\cdot,\cdot)\) is the beta function. The distribution accounts for uncertainty in \(p\): it averages the future binomial probability over the posterior distribution of \(p\). It is not the same as plugging a single estimate of \(p\) into a binomial distribution.
In some designs, terminal success is defined through a posterior criterion rather than a response-count boundary. For a fixed final sample size and a specified terminal rule, one can first identify which possible final response counts satisfy that rule, then sum their predictive probabilities. The calculation below uses a response-count boundary so that the event is explicit.
Why the Predictive Probability Has This Form
Conditional on a particular value of \(p\), the future count has a binomial distribution. Integrating that conditional probability over the posterior gives the predictive probability. In particular, the beta density is proportional to \(p^{A-1}(1-p)^{B-1}\), so multiplying it by the binomial likelihood for \(Y=y\) gives powers \(p^{A+y-1}\) and \((1-p)^{B+m-y-1}\). Integrating these powers from zero to one yields the beta function in the numerator:
The enumeration is exact apart from numerical rounding in evaluating the beta functions and summing the terms. As a check, the probabilities for \(y=0,\ldots,m\) must be nonnegative and sum to one, up to numerical precision.
Worked Example: Enumerating a Terminal Success Probability
Consider a hypothetical trial with a \(\mathrm{Beta}(1,1)\) prior. At the interim analysis, one response has been observed among two patients. Four patients remain, and terminal success is defined as at least three responses among all six patients. Calculate the predictive probability of terminal success exactly.
The posterior is \(\mathrm{Beta}(1+1,1+1)=\mathrm{Beta}(2,2)\). Since one response has already occurred, terminal success requires at least two responses among the four remaining patients: \(Y\geq 2\). For this posterior and \(m=4\), the beta-binomial probabilities are:
Therefore,
Under the stated model and prior, the predictive probability of reaching at least three responses by the end of the trial is 0.6286. This probability is conditional on the observed interim data and the model; it is not a probability that the treatment is effective in a broader population without reference to the model.
Monte Carlo Estimation and Its Error
To simulate from the same predictive distribution, repeat the following steps independently \(R\) times: draw \(p^{(j)}\) from the interim posterior \(\mathrm{Beta}(A,B)\), then draw \(Y^{(j)}\) from \(\mathrm{Binomial}(m,p^{(j)})\). Define \(I_j=1\) if the simulated outcome meets the terminal success rule and \(I_j=0\) otherwise. The Monte Carlo estimate is the proportion of simulated outcomes meeting the rule.
Each \(I_j\) is a Bernoulli random variable with success probability \(q\), provided each replicate is generated from the specified posterior predictive distribution and the replicates are independent. Thus \(E(\widehat q_{\mathrm{MC}})=q\), and
The standard error describes simulation noise in estimating \(q\); it is not the posterior standard deviation of the treatment response probability \(p\), nor a measure of clinical uncertainty in the trial outcome. A rough normal-approximation interval for the Monte Carlo estimate is \(\widehat q_{\mathrm{MC}}\pm 1.96\widehat{SE}_{\mathrm{MC}}\). This approximation can be unreliable when \(R\) is small or the estimated probability is near zero or one; in those settings, use a binomial interval designed for the simulation successes and failures.
Worked Example: Simulation Noise Near a Decision Boundary
Use the hypothetical trial in the previous example, for which exact enumeration gives \(q=22/35=0.6286\). Suppose the prespecified interim rule is to continue if the predictive probability of terminal success is at least 0.61. A simulation with \(R=1{,}000\) independent replicates happens to produce 600 outcomes meeting the terminal success rule.
The simulated estimate is
Its estimated Monte Carlo standard error is
A rough 95% Monte Carlo interval is \(0.600\pm1.96(0.01549)\), or approximately \((0.5696,0.6304)\). The simulated estimate alone is below the 0.61 boundary and would suggest stopping under a rule that stops when the probability is below 0.61. Exact enumeration gives 0.6286, above the boundary, and therefore indicates continuation. The interval also spans the boundary, signaling that this simulation run is not sufficiently decisive. It is an interval for Monte Carlo estimation error, not a Bayesian credible interval for \(p\) or for the trial’s treatment effect.
This example shows why a simulation estimate should not automatically be treated as exact when the interim rule is threshold-based. If simulation must be used, increase \(R\) or use an explicit uncertainty-aware decision policy specified in advance. Repeatedly simulating until a preferred decision appears would not be a valid remedy.
Choosing the Number of Replicates
For a fixed number \(R\) of independent replicates, the variance \(q(1-q)\) is at most \(1/4\), since \(q(1-q)\leq1/4\) for \(0\leq q\leq1\). This gives a conservative standard-error bound of \(1/(2\sqrt{R})\). A simulation size should be chosen for a stated precision target, not merely because a round number of replicates is customary.
Worked Example: A Conservative Simulation Size
Suppose the goal is to make a one-sided 95% normal-approximation Monte Carlo error margin no greater than 0.0200, whatever the unknown predictive probability \(q\). Using the worst-case variance \(q(1-q)=0.25\), require
Squaring both sides and rearranging gives
Because \(R\) must be an integer and must satisfy the inequality, at least \(1{,}692\) replicates are required by this approximation. This is a conservative precision calculation, not a guarantee that a simulation estimate cannot fall on the other side of an interim boundary. If a boundary is especially consequential, plan greater precision and examine the uncertainty in relation to the distance from that boundary.
Diagnostics, Alternatives, and Limitations
Exact enumeration is generally preferable for a single binary endpoint when the number of future patients is modest: it has no Monte Carlo sampling error and is straightforward to reproduce. Monte Carlo becomes attractive when the future event involves many components, complex dependence, or calculations that make a direct sum unwieldy. It can also provide a practical check on an exact implementation. Neither method repairs a misspecified prior, likelihood, or terminal success rule; both calculate a probability under the model supplied.
Useful diagnostics for simulation include checking that the posterior draws and future outcomes follow the intended distributions, verifying that the simulated event indicator corresponds exactly to the terminal rule, and comparing estimates across independent batches. Large differences between batches suggest that \(R\) may be inadequate, although similar batch estimates do not prove adequate precision. For rare events, a run with zero simulated successes does not establish that \(q=0\); it may simply mean that too few replicates were generated to observe the event.
For enumeration, check that all qualifying values of \(y\) are included and no others are included, particularly when the boundary is an integer count. Confirm that the predictive probabilities sum to one. If \(m\) is large, direct calculations of beta functions or binomial coefficients can overflow or underflow in ordinary arithmetic; stable implementations use log-gamma or log-probability calculations. Such numerical precautions improve computation but do not change the mathematical event being evaluated.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A trial has \(x=2\) responses at interim and requires at least 5 responses by the end. There are \(m=4\) patients remaining. What future response counts qualify for terminal success?
- A Monte Carlo calculation uses \(R=2{,}500\) replicates and estimates \(q\) as 0.40. Calculate its estimated Monte Carlo standard error.
- Why is a Monte Carlo estimate of 0.58 not enough by itself to justify stopping at a boundary of 0.60?
- For a beta-binomial predictive distribution, what is the key difference between exact enumeration and simulation in their uncertainty?
Solutions. (1) Success requires \(x+Y\geq5\), so \(2+Y\geq5\), or \(Y\geq3\). The qualifying counts are \(3\) and \(4\). (2) \(\widehat{SE}_{\mathrm{MC}}=\sqrt{0.40(0.60)/2{,}500}=\sqrt{0.000096}=0.009798\), approximately 0.0098. (3) The estimate has Monte Carlo error; without its standard error or a suitable interval, it is unclear whether the underlying predictive probability is below or above 0.60. (4) Exact enumeration sums the qualifying beta-binomial probabilities and has no Monte Carlo sampling error, while simulation estimates the same probability with random error that generally decreases as the number of independent replicates increases.