Monte Carlo & Randomized Methods

the Monte Carlo error

When you estimate something by averaging random samples, your answer is itself random — run the simulation again with new random draws and you get a slightly different number. The natural question is: how far off is my estimate likely to be? The Monte Carlo error is the size of that random wobble, and the beautiful thing is that the simulation can ESTIMATE its own error from the very same samples, giving you an honest error bar rather than a bare guess.

Here is the precise statement, and it rests on the central limit theorem. Suppose your estimate is the sample mean of N independent draws of a quantity with true standard deviation sigma. The estimate's own standard deviation — the standard error — is sigma / sqrt(N). You do not know sigma, but you estimate it by the sample standard deviation s of your draws, so the reported error bar is s / sqrt(N). The central limit theorem says the estimate is approximately normally distributed around the true value, so a 95% confidence interval is about estimate plus or minus 1.96 * s / sqrt(N): roughly, the truth is within two standard errors of your estimate about 19 times out of 20. This is why a Monte Carlo result should always come with error bars, not just a number.

Two honest points fall out of the formula. First, the sqrt(N) in the denominator is the source of Monte Carlo's slowness: to halve the error you must quadruple N, and to add a decimal digit you need 100 times the work — the 1/sqrt(N) law again. Second, the error is controlled by sigma, the integrand's variability, and that is the lever variance-reduction techniques (importance sampling, control variates, antithetic and stratified sampling) pull: shrink sigma and you shrink the error at the SAME N, sometimes dramatically. The catch behind the catch: these error bars assume independent samples and a finite variance; correlated draws (as in MCMC) or heavy-tailed integrands with infinite variance break the clean s/sqrt(N) formula and need more careful treatment.

Estimate the mean of a quantity from N = 10,000 draws and find sample mean 2.713 with sample standard deviation s = 1.5. The standard error is 1.5 / sqrt(10000) = 0.015, so you report 2.713 plus or minus 0.030 (95% interval). To shrink that interval to plus or minus 0.003 you would need N = 1,000,000 — a hundredfold more samples.

The error bar s/sqrt(N) lets a simulation report how trustworthy its own answer is.

The s/sqrt(N) error bar assumes INDEPENDENT samples and a FINITE variance. Correlated draws (MCMC) inflate the true error well beyond s/sqrt(N), and heavy-tailed integrands with infinite variance break the central-limit guarantee entirely.

Also called
standard error of the meanMonte Carlo standard errorstatistical error蒙地卡羅標準誤統計誤差