Monte Carlo Uncertainty in a Simulated Type I Error Rate
A simulation can estimate how often an adaptive test rejects \(H_0\) when the null model is true. But the estimated rate is itself random: another set of simulated trials could produce a different number of rejections. Monte Carlo precision describes this simulation-to-simulation variability. It is separate from uncertainty about whether the simulated model represents the scientific setting adequately.
The earlier material on simulating Type I error across adaptation rules concerns how to generate trial outcomes and apply the complete test procedure. Here, take that procedure as specified and quantify the sampling uncertainty in its simulated rejection rate. The target is the Type I error probability for a particular null distribution, design, adaptation rule, and rejection criterion—not a universal guarantee over every possible null parameter value.
This binomial model requires independent replicates generated under the same specified null scenario, with the same analysis rule applied to each. Any randomization used by the trial procedure should be generated as part of each replicate when it belongs to the design. If the simulated trials share random inputs or are otherwise dependent, the binomial standard error below does not automatically apply. Correctly simulating the specified null scenario is also essential: a narrow interval cannot repair an incorrectly coded adaptation rule or an inappropriate null model.
Standard Error and Confidence Interval
Under the binomial model, \(E(\hat{\pi})=\pi\) and \(\operatorname{Var}(\hat{\pi})=\pi(1-\pi)/M\). Since \(\pi\) is unknown, estimate the standard deviation of \(\hat{\pi}\) by substituting \(\hat{\pi}\):
This is the Monte Carlo standard error (MCSE). It measures typical variation in the estimated rejection proportion across repeated simulations of size \(M\), under the stated binomial assumptions. It is not the standard error of a treatment effect estimated within one simulated trial.
A simple approximate interval is \(\hat{\pi}\pm z_{1-\gamma/2}\widehat{SE}_{MC}\), where \(1-\gamma\) is the confidence level. This Wald interval is convenient when \(M\hat{\pi}\) and \(M(1-\hat{\pi})\) are not small, but it can extend beyond zero or one and performs poorly near those boundaries. The Wilson score interval is a useful alternative. Put \(z=z_{1-\gamma/2}\); its center and half-width are:
The Wilson interval is \([C-H,C+H]\). It follows by inverting the binomial score test: retain candidate values \(\pi\) for which the observed proportion is within \(z\) estimated standard errors of \(\pi\), and solve that inequality for \(\pi\). Unlike the Wald interval, the resulting limits stay within \([0,1]\). An exact binomial interval is another option, particularly when the count of rejections is very small; exact intervals can be conservative because the binomial count is discrete.
Worked Example: MCSE and a 95% Wilson Interval
Suppose a hypothetical validation simulation runs \(M=10{,}000\) independent trials under a specified null model. The complete adaptive test rejects \(H_0\) in \(K=493\) trials. Thus \(\hat{\pi}=493/10{,}000=0.04930\).
The estimated Monte Carlo standard error is
For a 95% Wilson interval, use \(z=1.96\). Substitution into the center formula gives
The half-width is
Therefore the interval is approximately \([0.04523,0.05372]\). Under the assumed simulation model, this procedure gives a 95% confidence interval for the test’s Type I error probability. It includes the nominal level \(0.05\), so these simulation results do not show a clear discrepancy from that level. Inclusion is not proof that the true simulated rejection probability equals \(0.05\), and the interval says nothing by itself about null scenarios that were not simulated.
Choosing a Simulation Size for Desired Precision
Before running a large validation, it is often useful to determine how many replicates are needed for a target margin of error. For a two-sided confidence level \(1-\gamma\), a normal-approximation interval has half-width approximately
Solving for \(M\), and substituting a planning value \(q\) for the unknown \(\pi\), gives
Round the result up to a whole number. The choice of \(q\) should be justified by the anticipated Type I error rate or a pilot simulation. Since \(q(1-q)\leq 1/4\), using \(q=0.5\) gives a conservative size for the approximate interval’s standard error when no plausible rate is available. For a test intended to have Type I error near \(0.05\), planning around \(q=0.05\) is usually less conservative but requires confidence that this is a reasonable planning value.
Worked Example: Planning for a 0.002 Margin of Error
A hypothetical validation aims for a 95% confidence interval with approximate half-width at most \(d=0.002\) around a Type I error rate expected to be near \(q=0.05\). With \(z=1.96\),
Thus, use at least \(45{,}619\) replicates as a normal-approximation planning value, then round upward as appropriate. The approximation is based on an anticipated rate, not a guarantee that the realized interval will have exactly that width. If no reliable planning value is available, the conservative choice \(q=0.5\) gives
The conservative calculation is much larger because the binomial variance is greatest at \(\pi=0.5\). In either case, the chosen size addresses Monte Carlo precision for the simulated scenario; it does not determine whether the scenario is sufficient to establish overall Type I error control.
Rare Rejections, Comparisons, and Failure Modes
When no simulated trial rejects, the plug-in MCSE is zero. That is a computational consequence of substituting \(\hat{\pi}=0\), not evidence that the underlying Type I error probability is zero. For example, if \(K=0\), a two-sided 95% exact binomial interval has lower limit zero and upper limit \(1-0.025^{1/M}\). With \(M=2{,}000\), the upper limit is approximately \(0.001843\). The simulation is consistent with a small positive rejection probability; it does not establish that the probability vanishes.
Worked Example: Interpreting Zero Rejections
Suppose a hypothetical null simulation produces \(K=0\) rejections in \(M=2{,}000\) independent replicates. The observed rate is \(\hat{\pi}=0/2{,}000=0\), and the plug-in MCSE formula gives \(\sqrt{0(1-0)/2{,}000}=0\). That value should not be reported as proof of perfect Type I error control.
For a two-sided 95% exact binomial interval, the upper endpoint when \(K=0\) solves \(P(K=0\mid \pi)=0.025\). Since \(P(K=0\mid \pi)=(1-\pi)^{2{,}000}\),
The resulting interval is approximately \([0,0.001843]\). Under the specified null simulation model, this interval quantifies uncertainty in the rejection probability despite the absence of observed rejections. If a test designed for a nominal level of \(0.05\) produces no rejections, check the simulated inputs and rejection rule as well as considering whether the test is genuinely conservative in that scenario.
The standard error formula assumes independent replicates and a fixed simulation size. Repeatedly checking the estimate and stopping as soon as the interval appears sufficiently narrow can invalidate ordinary fixed-\(M\) confidence-interval coverage. Set \(M\) in advance, or use an interval and stopping rule specifically justified for sequential Monte Carlo. Likewise, if results across several adaptation rules are presented as a family of simultaneous claims, separate 95% intervals do not automatically provide 95% simultaneous coverage.
These calculations address random error from finite simulation. They do not diagnose all errors in the validation. A coding error, an incorrectly generated null distribution, or failure to include all parts of the adaptation algorithm can make the estimate precise but wrong for the intended procedure. The binomial calculations also apply to a particular simulated null configuration. Establishing control across a composite null may require examining appropriate parameter values or justifying why the selected scenario is conservative.
| Approach | Strength | Limitation |
|---|---|---|
| MCSE with a Wald interval | Simple and directly shows the scale of simulation variation. | Can be inaccurate near zero or one; limits can fall outside the probability range. |
| Wilson score interval | Usually behaves better than the Wald interval and stays within zero and one. | Still an approximate interval, particularly relevant when the rejection count is very small. |
| Exact binomial interval | Provides coverage based on the binomial model, including when zero rejections occur. | Can be conservative and wider than approximate alternatives because the count is discrete. |
Common Mistake and Practical Checks
Wrong reasoning: “The simulated rate is \(0.0493\), close to \(0.05\), so the test has been shown to control Type I error at \(0.05\).” The point estimate alone ignores Monte Carlo variability and applies only to the simulated null scenario.
Correction: Report \(K\), \(M\), \(\hat{\pi}\), an MCSE or confidence interval, and the null scenario and test procedure used. Compare the interval with the nominal level as a description of simulation uncertainty, not as a substitute for checking the simulation design. If the interval is too wide for the intended assessment, increase the prespecified simulation size. If the result is surprising, verify that each replicate is independent, the adaptation and stopping rules are implemented as intended, and rejection is defined consistently with the test.
For a target half-width \(d\), the approximate planning equation also shows the basic cost of greater precision: \(M\) grows proportionally to \(1/d^2\). Halving the desired half-width therefore requires about four times as many replicates, all else equal. This makes explicit why a very precise validation can require substantial computation even when each simulated trial is inexpensive.
Check Your Understanding
Answer each question using the binomial simulation model and the distinction between Monte Carlo uncertainty and model validity.
- A fixed simulation runs \(M=5{,}000\) independent null trials and rejects \(H_0\) in \(K=260\). Calculate \(\hat{\pi}\) and the estimated MCSE.
- For 95% precision with target half-width \(d=0.005\), plan using \(q=0.05\). Approximately how many replicates are required?
- Why is a plug-in MCSE of zero after zero observed rejections not evidence that the Type I error probability is zero?
- What is one reason a narrow Monte Carlo confidence interval might still fail to establish that a test controls Type I error in the intended setting?
Solutions. (1) \(\hat{\pi}=260/5{,}000=0.05200\). The estimated MCSE is \(\sqrt{0.05200(0.94800)/5{,}000}=\sqrt{0.0000098592}\approx 0.003140\). (2) Using \(z=1.96\), \(M\approx 1.96^2(0.05)(0.95)/(0.005)^2=0.182476/0.000025=7{,}299.04\), so round up to at least \(7{,}300\) replicates. (3) The plug-in estimate substitutes the observed rate of zero into the formula, but finite simulation can produce no rejections even when the true probability is positive; use an interval that remains informative at the boundary, such as an exact binomial interval. (4) The simulated null scenario could be misspecified, the adaptation rule could be incorrectly coded, or the result could apply only to one point in a composite null. Monte Carlo precision quantifies finite-simulation uncertainty, not those sources of error.