Why Monte Carlo Error Matters
A simulation study estimates an operating characteristic by repeating a trial-generating process a finite number of times. For example, the estimated rejection rate is the fraction of simulated trials in which a specified test rejects \(H_0\). If the simulation were run again under the same conditions, that fraction would generally change. This run-to-run variation is Monte Carlo error.
Monte Carlo error is not the same as uncertainty about the data-generating mechanism, the treatment effect, or the appropriateness of a statistical model. It quantifies the sampling variation caused by using a finite number of simulation replicates to estimate a characteristic of the simulation procedure. An estimate without a measure of Monte Carlo error can look more precise than the simulation supports.
The basic calculations depend on what is recorded for each replicate. Rejection and coverage are binary outcomes, so their estimates are proportions. A mean outcome is estimated from a numerical value recorded in each replicate. In both cases, the unit of analysis for Monte Carlo error is the simulation replicate, not an individual trial participant.
Monte Carlo Error for Rejection and Coverage Rates
This formula follows from the variance of a Bernoulli random variable. Under the stated assumptions, \(I_r\) has mean \(p_{\mathrm{rej}}\) and variance \(p_{\mathrm{rej}}(1-p_{\mathrm{rej}})\). The average of \(R\) independent indicators therefore has variance \(p_{\mathrm{rej}}(1-p_{\mathrm{rej}})/R\). Replacing the unknown probability with the observed proportion gives the estimated standard error.
Coverage is handled in exactly the same way. Let \(C_r=1\) if the confidence interval from replicate \(r\) contains the target parameter, and \(C_r=0\) otherwise. The estimated coverage probability is \(\hat{p}_{\mathrm{cov}}=\sum C_r/R\), with estimated Monte Carlo standard error \(\sqrt{\hat{p}_{\mathrm{cov}}(1-\hat{p}_{\mathrm{cov}})/R}\). The formula concerns variation in the estimated coverage across simulation runs; it does not describe the width of the confidence interval produced in any one trial.
Intervals for Simulated Proportions
For a sufficiently large number of replicates, a common approximate 95% Monte Carlo confidence interval for a simulated proportion is the estimate plus or minus 1.96 estimated standard errors. This is a normal approximation to the binomial sampling distribution. It is most dependable when the expected numbers of successes and failures, \(R p\) and \(R(1-p)\), are not small. The confidence level describes the long-run performance of the interval procedure across repeated simulation runs under the same fixed scenario.
An interval for a simulated rejection rate gives a range of plausible values for the rejection probability of the simulated procedure under that scenario, reflecting finite simulation size. If the scenario is a null scenario, that rejection probability is the simulated Type I error rate. An interval for coverage similarly reflects finite-run error in estimating the procedure's coverage probability. Neither interval represents uncertainty about whether \(H_0\) is true, nor does it account for uncertainty in how well the simulation represents a real trial.
Worked Example: Monte Carlo Error for a Rejection Rate
In a hypothetical null scenario, 2,000 independent trial replicates are simulated. The prespecified test rejects \(H_0\) in 104 replicates. Estimate the rejection rate, its Monte Carlo standard error, and an approximate 95% Monte Carlo confidence interval.
The estimated rejection rate is \(104/2{,}000=0.0520\), or 5.20%. Treating each replicate's rejection indicator as Bernoulli, the estimated Monte Carlo standard error is
The approximate 95% interval, retaining the unrounded standard error for the multiplication, is
Thus, the simulation estimates a rejection probability of 5.20%, with an approximate 95% Monte Carlo interval from 4.23% to 6.17%. This interval describes finite-run simulation error under the specified null scenario; it does not establish that the test's true rejection probability is exactly 5%, or explain any departure from a nominal level.
Worked Example: Monte Carlo Error for Coverage
In a hypothetical simulation with 1,000 independent replicates, the confidence interval constructed in each replicate contains the target parameter in 938 cases. Calculate the estimated coverage, Monte Carlo standard error, and approximate 95% Monte Carlo interval.
The coverage estimate is \(938/1{,}000=0.938\), or 93.8%. Its estimated standard error is
Using that unrounded value, the approximate interval is
The estimated coverage is 93.8%, and the approximate 95% Monte Carlo interval is 92.31% to 95.29%. The difference between the estimate and a nominal 95% coverage is not, by itself, proof of a coverage defect: finite simulation error is one possible explanation, and other features of the design and analysis also matter.
Monte Carlo Error for Mean Outcomes
Some performance metrics are numerical rather than binary. For example, a replicate may produce an estimator, a treatment-effect estimate, or a measure of allocation imbalance. Let \(Y_r\) be the numerical outcome from replicate \(r\), and suppose the \(R\) replicate outcomes are independent draws from a distribution with finite variance. The Monte Carlo estimate of the mean outcome is \(\bar{Y}=\sum Y_r/R\). Its estimated standard error is \(s_Y/\sqrt{R}\), where \(s_Y\) is the sample standard deviation of the replicate outcomes.
The second expression is a two-sided 95% interval using the \(t\) distribution with \(R-1\) degrees of freedom. It is exact when replicate outcomes are normally distributed and is often a useful approximation for a mean with many independent replicates and finite variance. Strong skewness, heavy tails, or influential extreme values can make the approximation less reliable, especially when \(R\) is small.
Worked Example: Monte Carlo Error for a Mean Outcome
A hypothetical simulation records the estimated treatment effect, in points, from each of 400 independent replicates. Across replicates, the mean estimate is 2.40 points and the sample standard deviation is 1.20 points. Estimate the Monte Carlo standard error and an approximate 95% interval for the mean outcome.
The standard error is the replicate-level standard deviation divided by the square root of the number of replicates:
With 399 degrees of freedom, the 97.5th percentile of the \(t\) distribution is approximately 1.966. The resulting interval is
The simulated mean is 2.40 points, and its approximate 95% Monte Carlo interval is 2.282 to 2.518 points. This measures precision in estimating the mean across the simulation replicates, not the uncertainty interval for a treatment effect in a single trial.
Planning Replicates and Checking the Calculation
Monte Carlo standard errors shrink at a rate proportional to \(1/\sqrt{R}\). Consequently, reducing the standard error by half requires about four times as many replicates. For a target standard error \(\delta\) for a proportion near \(p\), rearranging the variance formula gives an approximate replicate requirement:
For example, if a rejection probability is expected to be near 0.05 and the desired Monte Carlo standard error is at most 0.005, then \(R\) should be at least \(0.05(0.95)/(0.005)^2=1{,}900\). Since the probability is only approximately known in advance, the achieved standard error should still be calculated from the actual simulated proportion.
A useful check for a proportion is that the estimated standard error is largest near \(\hat{p}=0.5\) and decreases as the estimate approaches 0 or 1, for fixed \(R\). A useful check for a mean is that the estimated standard error is \(s_Y/\sqrt{R}\): increasing \(R\) alone should decrease it at the square-root rate if the replicate variability remains similar. If the reported error is implausibly small, verify the replicate count, the denominator, and whether variability was calculated across replicates rather than across individuals within a simulated trial.
The normal interval for a proportion can extend below 0 or above 1, and can perform poorly when the event is rare or nearly certain. In those cases, a Wilson interval or an exact binomial interval can provide a better-behaved confidence interval for the probability. This does not change the underlying estimand or the need to report the number of replicates and observed event count. For mean outcomes, inspect the replicate-level distribution and summaries for skewness, outliers, and unusual variability before relying on a \(t\)-based interval.
Assumptions, Alternatives, and Limitations
The usual formulas assume that the simulation replicates are independent and generated under the same fixed scenario, with the same analysis rule applied each time. A replicate must be defined consistently: for example, one complete simulated trial, including its sequential allocation and stopping process where applicable. An adaptive allocation process within a trial does not make the trial-level replicates dependent; it is the relationship between separate simulation runs that matters here.
If simulation runs share random numbers, are reused across conditions, or are generated by a dependent sampling scheme, the simple independent-replicate formulas may not apply as written. Likewise, repeatedly checking results and stopping when a desired estimate appears sufficiently favorable can make conventional interval interpretations unreliable. Set the replication plan in advance, or use an uncertainty method that accounts for the actual sampling and stopping procedure.
| Quantity being estimated | Replicate-level data | Monte Carlo standard error | Common interval approach |
|---|---|---|---|
| Rejection probability | 0 or 1 rejection indicator | \(\sqrt{\hat{p}(1-\hat{p})/R}\) | Normal approximation; Wilson or exact binomial interval when appropriate |
| Coverage probability | 0 or 1 coverage indicator | \(\sqrt{\hat{p}(1-\hat{p})/R}\) | Normal approximation; Wilson or exact binomial interval when appropriate |
| Mean outcome | Numerical outcome per replicate | \(s_Y/\sqrt{R}\) | \(t\) interval, with attention to distribution shape |
Increasing the number of replicates addresses Monte Carlo error only. It does not repair a misspecified data-generating mechanism, incorrect simulation code, or a poor choice of operating characteristic. Those are distinct sources of uncertainty or error and require separate checks. A careful report states the scenario, the number of replicates, the estimated metric, its Monte Carlo standard error or interval, and any important limitations of the approximation.
Common Mistake
Check Your Understanding
Work through each calculation, then compare with the solutions below.
- A hypothetical simulation has 600 independent replicates, with rejection in 36. Calculate the estimated rejection rate and its Monte Carlo standard error.
- In 500 independent replicates, 490 confidence intervals cover the target parameter. Calculate the estimated coverage and an approximate 95% normal Monte Carlo interval. What caution applies?
- For 100 replicate-level outcomes, the sample mean is 5.0 units and the sample standard deviation is 2.0 units. Calculate the estimated Monte Carlo standard error of the mean.
- If a simulated probability is expected to be 0.20, approximately how many independent replicates are needed for a Monte Carlo standard error no greater than 0.01?
Solutions. (1) The rejection estimate is \(36/600=0.0600\). Its standard error is \(\sqrt{0.0600(0.9400)/600}=\sqrt{0.000094}\approx0.009695\), or about 0.97 percentage points. (2) Coverage is \(490/500=0.980\). The standard error is \(\sqrt{0.980(0.020)/500}=\sqrt{0.0000392}\approx0.006261\). The normal interval is \(0.980\pm1.96(0.006261)\approx(0.9677,0.9923)\). Because the estimate is close to the boundary 1, a Wilson or exact binomial interval may be preferable to the normal approximation. (3) The standard error is \(2.0/\sqrt{100}=0.20\) units. (4) Rearranging gives \(R\geq0.20(0.80)/(0.01)^2=1{,}600\) independent replicates.