Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › Monte Carlo Precision for Expected Sample Size

Sample Size and Expected Sample Size · Tutorial 231 of 499

Monte Carlo Precision for Expected Sample Size

Use replicate-to-replicate variability to measure simulation precision, form a confidence interval for expected enrollment, and plan a simulation size that meets a stated precision goal.

Advanced 9 min read

What You'll Learn

  • Define the simulated enrollment output and the expected-enrollment quantity it estimates
  • Calculate Monte Carlo standard error from the standard deviation across simulation replicates
  • Construct and interpret a confidence interval for expected enrollment
  • Distinguish Monte Carlo uncertainty from variability in trial enrollment and uncertainty in planning assumptions
  • Choose a simulation size for a target confidence-interval half-width and verify the achieved precision
  • Diagnose when a usual t-based interval or a simple replicate-count calculation may be unreliable

Why Monte Carlo Precision Matters

A simulation estimates expected enrollment by repeatedly generating the trial outcomes and applying the planned MAMS stopping and selection rules. The resulting estimate is itself random: a new set of simulation runs would usually give a somewhat different average. Monte Carlo precision describes this run-to-run uncertainty in the simulated estimate. It does not describe how much enrollment varies from trial to trial, and it does not account for uncertainty in the assumed effects, variances, or other design inputs.

The earlier material on estimating expected enrollment by simulation defines the enrollment outcome for each simulated trial. Here, treat each completed simulation as one draw from the enrollment distribution under a fixed design and fixed scenario. The question is how accurately the average of a finite number of these draws estimates the scenario’s true expected enrollment.

Definition: Let \(Y_i\) be the total enrollment in simulated trial \(i\), for \(i=1,\ldots,M\), under one fixed MAMS design and scenario. The target is \(\theta=E(Y_i)\), the expected enrollment under that scenario. The Monte Carlo estimate is \(\bar{Y}=M^{-1}\sum_{i=1}^{M}Y_i\). The Monte Carlo standard error estimates the standard deviation of \(\bar{Y}\) over repeated sets of \(M\) simulations.

The replicate outputs should be independent and generated under the same design and scenario. In practice, this means using independent simulation random streams and applying the same enrollment rules and inputs on every run. Enrollment is typically bounded by the design’s maximum enrollment, so its variance is finite. The outputs may be discrete or skewed, however, and those features matter when assessing the quality of a confidence interval.

Monte Carlo Standard Error and Confidence Interval

Let \(s_Y\) be the sample standard deviation of the \(M\) simulated enrollment values, calculated using denominator \(M-1\). The estimated Monte Carlo standard error of their mean is \(s_Y/\sqrt{M}\). It decreases in proportion to \(1/\sqrt{M}\): multiplying the number of simulations by four approximately halves the standard error, rather than reducing it by a factor of four.

$$ s_Y=\sqrt{\frac{\sum_{i=1}^{M}(Y_i-\bar{Y})^2}{M-1}}, \qquad \widehat{SE}_{MC}(\bar{Y})=\frac{s_Y}{\sqrt{M}}. $$

A conventional two-sided \(100(1-\alpha)\%\) Monte Carlo confidence interval is

$$ \bar{Y}\ \pm\ t_{1-\alpha/2,\,M-1}\frac{s_Y}{\sqrt{M}}, $$

where \(t_{1-\alpha/2,\,M-1}\) is the corresponding quantile of the \(t\) distribution with \(M-1\) degrees of freedom. If the replicate outputs are normally distributed, this interval has exact coverage under the independent, identically distributed simulation model. For sufficiently large \(M\), it is commonly used as an approximate interval for the mean even when the enrollment distribution is not normal, by the central limit theorem. The interval quantifies Monte Carlo uncertainty about \(\theta\), not a probability that the fixed value \(\theta\) lies in this particular interval.

Justification: If the simulation outputs are independent with common variance \(\sigma_Y^2\), then $$ \operatorname{Var}(\bar{Y})=\operatorname{Var}\left(\frac{1}{M}\sum_{i=1}^{M}Y_i\right) =\frac{1}{M^2}\sum_{i=1}^{M}\operatorname{Var}(Y_i) =\frac{\sigma_Y^2}{M}. $$ Thus the standard deviation of the simulated mean is \(\sigma_Y/\sqrt{M}\). Replacing the unknown \(\sigma_Y\) with \(s_Y\) gives the estimated Monte Carlo standard error. Studentizing the mean by this estimated standard error gives the stated \(t\) interval exactly for normal outputs and approximately for sufficiently large samples in many nonnormal cases.

Worked Example: Interval for Expected Enrollment

Suppose 400 independent simulations of a hypothetical MAMS design produce a mean total enrollment of 286.3 participants and a sample standard deviation of 52.0 participants. Calculate a 95% Monte Carlo confidence interval for expected enrollment.

The estimated Monte Carlo standard error is

$$ \widehat{SE}_{MC}=\frac{52.0}{\sqrt{400}}=\frac{52.0}{20}=2.60\text{ participants}. $$

For 399 degrees of freedom, the 97.5th percentile of the \(t\) distribution is approximately 1.966. The half-width is therefore

$$ 1.966(2.60)=5.1116\text{ participants}. $$

The interval is

$$ 286.3\pm5.1116=(281.2,\ 291.4)\text{ participants}, $$

to one decimal place. Under the simulation assumptions, this procedure would capture the fixed expected enrollment in 95% of repeated sets of 400 runs in the long run. It is not a statement that 95% of future trials will enroll between 281.2 and 291.4 participants; future-trial variation is a different quantity.

Choosing a Simulation Size for a Precision Goal

A precision goal is often stated as a maximum confidence-interval half-width \(h\), in participants. If a pilot simulation suggests that the enrollment standard deviation is about \(s_{\text{pilot}}\), a first calculation replaces the \(t\) critical value with 1.96 for a 95% interval and solves for \(M\). Since the standard error is approximately \(s_{\text{pilot}}/\sqrt{M}\), the normal-approximation requirement is

$$ 1.96\frac{s_{\text{pilot}}}{\sqrt{M}}\le h \quad\Longrightarrow\quad M\ge\left(\frac{1.96s_{\text{pilot}}}{h}\right)^2. $$

Round up to a whole replicate. This is a planning approximation, not a guarantee: the pilot standard deviation is estimated, and the finite-\(M\) \(t\) critical value is slightly larger than 1.96. A careful plan checks the achieved half-width using the \(t\) critical value at the proposed \(M\), and the completed simulation reports its actual \(s_Y\) and interval.

Worked Example: Planning for a Two-Participant Half-Width

A pilot run for a hypothetical design gives an enrollment standard deviation of 34.0 participants. How many independent simulations are needed for an approximately 95% interval with half-width no greater than 2.0 participants?

The initial normal-approximation calculation is

$$ M\ge\left(\frac{1.96(34.0)}{2.0}\right)^2 =(33.32)^2=1110.22. $$

This suggests at least 1,111 runs before allowing for the finite-sample \(t\) critical value. Check the two nearby candidate counts using the pilot standard deviation. At \(M=1{,}112\), the 95% \(t\)-interval half-width is approximately

$$ t_{0.975,1111}\frac{34.0}{\sqrt{1112}} \approx 1.9621\frac{34.0}{33.3467} \approx 2.0005\text{ participants}, $$

which exceeds the strict 2.0-participant target. At \(M=1{,}113\),

$$ t_{0.975,1112}\frac{34.0}{\sqrt{1113}} \approx 1.9621\frac{34.0}{33.3617} \approx 1.9996\text{ participants}. $$

Thus 1,113 is the first of these checked counts that meets the target using the pilot standard deviation and the \(t\) critical value. Because the standard deviation is only a pilot estimate, the completed simulation must still be checked: if its observed \(s_Y\) is larger, its achieved half-width may exceed 2.0 participants.

Worked Example: Checking the Precision Actually Achieved

A separate hypothetical simulation uses \(M=2{,}500\) runs and yields \(\bar{Y}=312.4\) participants and \(s_Y=48.0\) participants. Calculate the Monte Carlo standard error and 95% interval, then assess a target half-width of 2.0 participants.

The estimated standard error is

$$ \widehat{SE}_{MC}=\frac{48.0}{\sqrt{2500}}=\frac{48.0}{50}=0.960\text{ participants}. $$

With 2,499 degrees of freedom, \(t_{0.975,2499}\) is approximately 1.961. The half-width is \(1.961(0.960)=1.8826\) participants, giving

$$ 312.4\pm1.8826=(310.5,\ 314.3)\text{ participants}. $$

The estimated half-width is below the 2.0-participant target, so this run meets that precision criterion. The interval remains an estimate of the simulation’s uncertainty about expected enrollment under the specified scenario; it does not capture uncertainty about whether the scenario’s assumptions are correct.

Diagnostics, Alternatives, and Limitations

Before relying on a Monte Carlo interval, check both the simulation process and the replicate-output distribution. Confirm that each run follows the intended enrollment rules, that no runs were accidentally duplicated, and that the design inputs are unchanged across replicates. Inspect a histogram or other summary of the simulated enrollments for strong skewness, unusual spikes, or a large mass at the maximum enrollment. Because enrollment is bounded and often discrete, nonnormality is not surprising; the key issue is whether the sampling distribution of the mean is adequately approximated at the chosen \(M\).

With substantial skewness or a small number of runs, the \(t\)-interval may be a poor approximation, despite the finite variance. Increasing \(M\) can improve the approximation, but it does not fix a coding error, dependence between runs, or a change in scenario inputs. A bootstrap interval computed by resampling the simulated outputs is one possible alternative for assessing uncertainty in their mean, although it too depends on the simulated sample being representative and may be unreliable when the effective number of distinct outputs is small. An analytic calculation, when available and applicable, avoids Monte Carlo error for that calculation; it does not remove uncertainty in the underlying design assumptions.

Avoid truncating a confidence interval merely because an endpoint falls outside the logically possible enrollment range. Such clipping can alter its coverage properties. Instead, investigate whether the approximation is appropriate and, if needed, use more simulations or a justified alternative method. Also distinguish precision planning from a guarantee: a chosen \(M\) based on pilot variability may miss the target if the final sample standard deviation is higher than expected.

Common mistake: Treating a small Monte Carlo standard error as evidence that expected enrollment is known precisely in practice. The standard error measures only the variability of the simulated average across repeated simulation batches. If assumed treatment effects, control rates, attrition, or other inputs are uncertain, the resulting expected-enrollment estimate can still be sensitive to those assumptions.

The main alternatives answer different questions. Reporting only \(\bar{Y}\) gives a point estimate but hides its Monte Carlo precision. Reporting \(\bar{Y}\), \(s_Y\), \(M\), and a confidence interval makes both the estimated expected enrollment and its simulation uncertainty visible. Increasing \(M\) is the direct way to reduce Monte Carlo error for one fixed scenario. Comparing scenarios requires care about how their simulations are generated; that comparison is a separate issue from estimating the precision of one scenario’s mean.

Check Your Understanding

Try each question, then compare your work with the solutions.

  1. A simulation has \(M=900\), \(\bar{Y}=250\) participants, and \(s_Y=45\) participants. What is the Monte Carlo standard error?
  2. For the simulation in Question 1, approximate a 95% confidence interval using a critical value of 1.96. Give the interval in participants.
  3. If the estimated standard deviation stays the same, approximately how many simulations are needed to halve the Monte Carlo standard error?
  4. Why does a 95% Monte Carlo confidence interval not mean that 95% of future trials will have enrollment inside the interval?

Solutions. (1) \(45/\sqrt{900}=45/30=1.50\) participants. (2) The half-width is \(1.96(1.50)=2.94\) participants, so the approximate interval is \(250\pm2.94=(247.06,\ 252.94)\) participants. (3) Since the standard error is proportional to \(1/\sqrt{M}\), halving it requires multiplying \(M\) by four: approximately 3,600 simulations. (4) The interval concerns uncertainty in the simulated estimate of the fixed expected enrollment. The enrollment of an individual future trial varies around that expectation and has its own distribution.

Clinical Biostats