Research Methods

How Many Simulations Are Enough?

A practical guide to Monte Carlo error: why the answer depends on the question, how to size and stop a simulation, why rare events need far more runs, and why a million runs of the wrong model are still wrong. Tested on a retirement plan built from 152 years of real US returns and on a leveraged fund.


When we simulate something to find out how likely an outcome is, how many simulations should we run?

Here is the situation that made me write about it. Suppose we ran 1,000 simulations and outcome A came up 497 times, outcome B 157 times and outcome C 346 times. We would estimate the probabilities as about 0.50, 0.15 and 0.35. But what if the probabilities were closer to each other, and the small differences between them were exactly what we cared about?

There is a convenient rule of thumb, which follows from the central limit theorem: if you want the error to be smaller than 1/x1/x⁠, run at least x2x^2 simulations. For an error below 0.01, run 10,000.

This article takes that rule seriously. It shows why it works, where it is exactly right, where it wastes computer time, and where it fails badly. Along the way it answers the question in the title the only honest way: it depends on the question you ask the simulation, and we can say precisely how.

The rule of thumb, and why it works

A Monte Carlo simulation answers a question by brute force: generate many random scenarios from a model and look at the results. To estimate the probability of an event, count how often it happened. With NN runs and kk occurrences, the estimate is the share p^=k/N\hat p = k/N (the hat marks an estimate of the true probability pp⁠).

The key point is that p^\hat p is random. Run the same simulation again with different random numbers and you get a slightly different share. The question “how many runs are enough?” is really the question “how much does p^\hat p wobble, and how much wobble can I accept?”

Two classical results answer it. The law of large numbers says the share settles down to the true probability as NN grows. The central limit theorem says how fast: for large NN the estimate is approximately normally distributed around pp⁠, with a standard deviation (called the standard error) of

SE(p^)=p(1−p)N\mathrm{SE}(\hat p)=\sqrt{\frac{p(1-p)}{N}}

About 95% of the time the estimate lands within 1.96 standard errors of the truth. That gives the familiar 95% confidence interval, p^±1.96 SE\hat p \pm 1.96\,\mathrm{SE}⁠. Its half-width is the “error” in the rule of thumb.

Now the rule appears almost by itself. The product p(1−p)p(1-p) is largest at p=12p=\tfrac12⁠, where it equals 14\tfrac14⁠. So the half-width is never more than

1.961/4N=0.98N1.96\sqrt{\frac{1/4}{N}}=\frac{0.98}{\sqrt{N}}

With N=x2N=x^2 runs this is 0.98/x0.98/x⁠, just under 1/x1/x⁠. The rule of thumb is the worst-case 95% confidence interval for a probability, and the near-cancellation of 1.96 and 12\tfrac12 is why it is so simple.

For the example above, with 1,000 runs, the 95% half-widths are about ±0.031 for A (0.497), ±0.023 for B (0.157) and ±0.029 for C (0.346). So “0.50, 0.15 and 0.35” is honest to roughly the second decimal and no further.

The same reasoning works for any average, not only for shares. If each run produces a number with standard deviation σ\sigma⁠, the average of NN runs has standard error σ/N\sigma/\sqrt N⁠, and a 95% half-width of ε\varepsilon needs

N≈(1.96 σε)2N \approx \left(\frac{1.96\,\sigma}{\varepsilon}\right)^2

runs. Everything in the rest of the article is a consequence of this formula: the error falls with the square root of the number of runs, and the constant in front depends on how variable the quantity is relative to the precision we want.

A question worth simulating: will the money last?

To see what this means in practice we need a real question. Here is a classic one from personal finance, and one of the most common everyday uses of Monte Carlo: if a retiree withdraws 4% of the starting balance each year, adjusted for inflation, what is the chance that the money runs out within 30 years?

The setup:

  • The portfolio is 60% US stocks and 40% 10-year US government bonds, rebalanced once a year.
  • Returns are real (after inflation) annual returns for 1871 to 2022, 152 years, built from Robert Shiller’s monthly data on the S&P Composite index, dividends, inflation and bond yields (details in the companion repository).
  • One simulated retirement draws 30 years at random from those 152 historical years, with replacement. This simple form of the bootstrap keeps the real distribution of good and bad years, including the crashes, but ignores the order in which years came; we return to that choice at the end.
  • At the start of each year we withdraw 0.04 of the starting balance; the plan fails if a withdrawal cannot be paid in full.

This is a statistical example, not advice about retirement plans. Its virtue here is that the simulated quantity is easy to understand and the true answer under this model can be computed very precisely: with 4 million simulated retirements the failure probability is 6.33%, accurate to about ±0.02 percentage points.

Figure 1. Five independent simulations of the 4% plan, each tracked as more retirements are added (one highlighted, four in grey). The shaded funnel is where 95% of estimates should fall at each number of runs: 1.96 standard errors either side of the long-run value of 6.33%. Hover to read values; drag to zoom. Source: annual real returns 1871–2022 from Robert Shiller's data; 60% stocks, 40% bonds; code in the companion repository.

After 1,000 retirements, the five runs reported 5.6%, 6.3%, 6.6%, 6.9% and 7.4%. Each of these would look perfectly authoritative on its own. The funnel shows the expected spread: at 1,000 runs the 95% half-width is about ±1.5 percentage points, and at 10,000 runs it is about ±0.5.

Figure 2 shows the same fact from another angle. Repeat the whole simulation 2,000 times at each size and look at the distribution of the answers.

Figure 2. The estimate is a random variable. Each histogram shows 2,000 repeated simulations of the 4% plan; the dashed line is the long-run value. The middle 95% of the estimates runs from 2% to 11% with 100 retirements per run, from 4.9% to 7.9% with 1,000, and from 5.9% to 6.8% with 10,000. Source: as Figure 1.

Each tenfold increase in runs narrows the histogram by a factor of about 10≈3.2\sqrt{10}\approx3.2⁠, exactly as the formula says. With 100 runs, a single simulation could easily have reported “2%” or “11%”.

The number of runs depends on the question

The same 30-year simulations can answer several different questions. Each needs a different number of runs, and seeing why is the core of this article. Here are five, from the easiest to the hardest:

  • The average final balance. On average across all simulated retirements, how much is left after 30 years? Here it is 2.60 times the starting balance in real terms (the mean; the median is 1.86, because a few very lucky paths pull the average up).
  • The chance of running out at 4%, the 6.33% from above.
  • The 10th percentile of the final balance: the level that the worst 10% of retirements end below, here 0.19 of the starting balance. Risk managers call the same idea, applied to losses, Value at Risk.
  • The chance of running out at 3%, a rarer event: 0.97%.
  • The average of the worst 10% of final balances, here 0.036. This answers “how bad is it when it is bad?” and is the idea behind Expected Shortfall, a tail measure widely used in risk management and bank regulation.
Figure 3. One simulation, five questions. Each line shows the 95% error of the estimate as a share of the true value, measured from 200 repeated simulations at each size (true values in the legend). All lines fall with the same slope, a halving of the error for every fourfold increase in runs; they differ in height. Source: as Figure 1.

To reach ±10% of the true value with 95% confidence, the five questions need about:

QuestionTrue valueRuns for ±10%
Average final balance2.60about 460
Chance of running out at 4%6.3%about 6,600
10th percentile of final balance0.19about 23,000
Chance of running out at 3%0.97%about 38,000
Average of the worst 10%0.036about 85,000

From the same simulation, the hardest question needs about 180 times more runs than the easiest. Three things drive the difference:

  1. Relative versus absolute error. The rule of thumb promises an absolute error: ±0.01 means one percentage point either way. For the 4% plan that is a 16% relative error, and for the 3% plan it is ±100% of the answer. If what matters is the size of the risk relative to itself (“is it 1% or 2%?”), the target has to be set relative to the value, and the required runs grow as the value shrinks.
  2. Tail questions use only a few runs. A percentile at 10% or an average of the worst 10% is decided by the one run in ten that lands in the tail. Effectively they are computed from a tenth of the sample, and the further into the tail, the smaller that fraction.
  3. Small samples can also be biased. With 100 runs the tail estimates were not only noisy but systematically off: the 10th percentile was 14% too high on average and the average of the worst 10% about 50% too high. The bias fades as runs are added, but it means the error bar of a small simulation can be centered on the wrong place.

Deeper look · optional mathematical depth

How many runs each question needs

Write z=1.96z=1.96 for 95% confidence, ε\varepsilon for the absolute half-width we accept, and rr for a relative one (r=0.1r=0.1 means ±10% of the true value).

An average. For a quantity with standard deviation σ\sigma and mean μ\mu⁠:

N=(zσε)2or, relative,N=(zr⋅σμ)2N=\left(\frac{z\sigma}{\varepsilon}\right)^2 \qquad\text{or, relative,}\qquad N=\left(\frac{z}{r}\cdot\frac{\sigma}{\mu}\right)^2

The ratio σ/μ\sigma/\mu (the coefficient of variation) is what makes a mean easy or hard. For the final balance it is about 1.03, so N≈(19.6×1.03)2≈400N\approx(19.6\times1.03)^2\approx400⁠, close to the 460 measured.

A probability. A share of 0/1 outcomes has σ2=p(1−p)\sigma^2=p(1-p)⁠, so

Nabs=z2 p(1−p)ε2,Nrel=z2 (1−p)p r2N_{\text{abs}}=\frac{z^2\,p(1-p)}{\varepsilon^2}, \qquad N_{\text{rel}}=\frac{z^2\,(1-p)}{p\,r^2}

The relative version grows like 1/p1/p⁠. Since NpNp is the expected number of times the event occurs, it can be rewritten as “keep going until about z2/r2≈385z^2/r^2\approx385 events have been seen”. For p=0.0633p=0.0633 this gives about 5,700 runs. The table’s 6,600 is measured from 200 repeated simulations, and an error measured that way is itself uncertain by roughly ±10%.

A percentile. The qq-quantile vqv_q of a quantity with density ff has asymptotic standard error

SE(v^q)≈q(1−q)/Nf(vq)\mathrm{SE}(\hat v_q)\approx\frac{\sqrt{q(1-q)/N}}{f(v_q)}

It is large when few outcomes lie near vqv_q (small ff⁠), which is the typical situation in a tail. A practical interval that needs no density estimate uses order statistics: sort the runs and take the values at positions Nq±zNq(1−q)Nq\pm z\sqrt{Nq(1-q)}⁠.

An Expected Shortfall. For the average of the worst share α\alpha⁠, write it as ES=v+E ⁣[(X−v) 1{X≤v}]/α\mathrm{ES}=v+\mathbb E\!\left[(X-v)\,\mathbf 1\{X\le v\}\right]/\alpha⁠, with vv the α\alpha-quantile and 1{⋅}\mathbf 1\{\cdot\} equal to 1 when the condition holds and 0 otherwise. Its standard error is approximately

SE(ES^)≈1αVar ⁣[(X−v) 1{X≤v}]N\mathrm{SE}(\widehat{\mathrm{ES}})\approx\frac{1}{\alpha}\sqrt{\frac{\mathrm{Var}\!\left[(X-v)\,\mathbf 1\{X\le v\}\right]}{N}}

and the factor 1/α1/\alpha is the price of averaging only the tail.

Rare events: count events, not runs

The probability formula hides a simple and useful fact. To pin down a probability to ±10% of its value, we need to observe the event about 385 times, whatever its probability. Rare events therefore need many runs simply to happen often enough.

Figure 4. Runs needed to estimate a probability p within a given share of its value, from the formula for a relative error in the deeper-look section above. The dashed line is the rule of thumb for an absolute error of 0.01. Marked: the two withdrawal plans and the leveraged-fund crash studied below. Hover for values.

Below a probability of about 4%, the 10,000 runs of the rule of thumb are not enough for ±10%; above it, they are more than enough. For the leveraged-fund event in the last part of this article, with a probability of about 0.1%, ±10% needs about 370,000 runs.

There is a sharper trap. If an event has a probability of 1 in 1,000 and we run 1,000 simulations, there is a 37% chance (0.99910000.999^{1000}⁠) that we never see it at all. The estimate is then exactly 0, and the textbook interval p^±1.96p^(1−p^)/N\hat p\pm1.96\sqrt{\hat p(1-\hat p)/N} is [0,0][0,0]⁠: a confident statement that the event is impossible. The fix is an interval that does not collapse at zero. The Wilson score interval does this, and so does the quick “rule of three”: when an event was never seen in NN independent runs, a 95% upper bound for its probability is about 3/N3/N⁠.

Try it below: choose how rare the event is and how many runs to make, and repeat the simulation to see how often it reports zero.

Close probabilities: comparing two plans

Back to the question in the opening: what if the probabilities are close and the difference is what matters?

Comparing two outcomes of the same simulation, such as 0.35 and 0.34, requires the error of the difference to be smaller than the difference itself. For two outcomes of a single run (they cannot both happen), the variance per run of the difference is pA+pB−(pA−pB)2p_A+p_B-(p_A-p_B)^2⁠. To bring the 95% half-width of the difference below one percentage point takes about 26,500 runs. To be reasonably sure of detecting a real one-point difference, with 80% statistical power (the chance of noticing an effect that is really there), takes about 54,000.

A common shortcut is to compute an interval for each probability and declare a difference when the intervals do not overlap. That test is too strict: two intervals can overlap even when the difference is clearly not zero, because the error of a difference is smaller than the sum of the two separate errors. The difference needs its own interval.

A more practical version of the question is comparing two plans. Is withdrawing 4.25% instead of 4% meaningfully riskier? Under this model the failure probabilities are 6.33% and 8.90%, a difference of 2.6 percentage points. There are two ways to estimate it:

  • run two separate simulations, one per plan; or
  • run both plans on the same simulated scenarios, so that every simulated retirement is lived once at 4% and once at 4.25%. This is called common random numbers.
Figure 5. Comparing a 4% and a 4.25% withdrawal plan. On the same scenarios, the error of the difference is about 2.4 times smaller for the same number of runs, which is the same precision with about 5.6 times fewer runs. Source: as Figure 1; the variance on shared scenarios is measured on 1,000,000 of them.

To estimate the difference within ±1 percentage point, two separate simulations need about 5,400 retirements each; shared scenarios need about 960. The reason is intuitive: every scenario in which the 4% plan fails is also a failure for the 4.25% plan, so most of the luck is common to both and cancels in the difference. Only the scenarios where the two plans disagree carry information about the difference.

The general lesson is that comparisons are cheaper than absolute answers when the noise can be shared. It applies whenever two variants of a strategy, a parameter or a design are compared by simulation.

Try it yourself: how many runs, how precise, and is the difference real?

The calculator below answers the three practical questions of this article for your own simulation. How many runs? gives the number of runs for a target precision, for a probability or an average, in absolute or relative terms. How precise is my result? turns a count of events into an interval that still works when no event was seen. Compare two tests whether two results really differ, for two outcomes of one simulation (the opening example), two separate simulations, or two variants on the same scenarios. The same calculator is also available on its own page.

When to stop: rules that look reasonable and rules that work

So far we fixed the number of runs in advance. In practice people often watch the estimate and stop when it looks precise enough. Is that safe?

I compared four stopping rules on the task “estimate a probability within ±10% of its value, with 95% confidence”, for probabilities from 50% down to 0.1%, repeating each rule 4,000 times:

  1. Fixed 10,000 runs, the rule of thumb for an absolute error of 0.01.
  2. Pilot run, then formula: run 1,000 simulations, plug the estimate into the formula for NN⁠, and run that many new ones. If the pilot saw no event, stop and report zero.
  3. Stop when the interval looks narrow: run in batches of 100 and stop as soon as the 95% half-width is at most 10% of the current estimate.
  4. Stop after 385 events: keep running until the event has been seen 385 times, then report (385−1)/(n−1)(385-1)/(n-1) with a Wilson interval. This is called inverse sampling and goes back to J. B. S. Haldane (1945).
Figure 6. Four stopping rules, each repeated 4,000 times per probability. Top: how often the reported 95% interval contained the true value (the dashed line is the promised 95%). Bottom: how often the estimate was within the ±10% target. Hover for the average number of runs and the share of estimates equal to zero. Source: binomial and negative binomial draws, equivalent to running the simulations one by one; code in the companion repository.

For common events all four rules behave. For rare ones they separate sharply:

  • Stopping when the interval looks narrow fails worst. For a 1-in-1,000 event, 91% of the simulations stopped after the first batch of 100 runs: no event had been seen, so the estimated probability was 0, the interval had width 0, and “zero width” counts as narrow. Its intervals contained the true value only 9% of the time. Even at a 1% probability it covered the truth only 60% of the time. Stopping when the estimate looks good selects the runs in which it looks better than it is.
  • The pilot run inherits the same problem at a smaller scale: 36% of the 1,000-run pilots saw no 1-in-1,000 event and stopped, so coverage was 61%.
  • The fixed 10,000 runs kept honest intervals (93% coverage), but for the rarest event the interval was very wide: only 37% of the estimates were within ±10%. The rule controls absolute error, as promised, and absolute error is the wrong target for rare events.
  • Stopping after 385 events gave 95% coverage, with at least 95% of the estimates within ±10%, at every probability, and it used about as many runs as the formula would have needed had we known pp in advance: about 3,850 at 10% and about 385,000 at 0.1%. It adapts to the rarity of the event by itself.

The practical version: decide in advance what you are estimating and how precisely; for a probability, run until the event has been seen enough times, not until the interval looks small; never trust a result with very few events; and run the whole simulation again with a different random seed as a cheap check that the answer does not move by more than the stated error.

Try it yourself: watch a simulation converge

The lab below runs the simulations of this article in your browser and draws the estimate and its 95% interval as runs are added. The guided tour walks through the main points: the estimate settles slowly, the band narrows like 1/N1/\sqrt N⁠, the “interval looks narrow” rule falls into the zero trap on a rare event, counting events fixes it, and (step 5, explained in the next section) smarter sampling reaches the same precision far faster. The lab is also available on its own page.

Cost versus accuracy: shrinking the noise instead of adding runs

The formula N≈(zσ/ε)2N\approx(z\sigma/\varepsilon)^2 offers two ways to buy accuracy. One is to raise NN⁠, which is expensive: halving the error costs four times the computing. The other is to lower σ\sigma⁠, the variability of what each run contributes, at the same NN⁠. Methods that do this are called variance reduction. We already met one, common random numbers, in the comparison of two plans.

To test the others on a case where they matter, I return to a rare event from an earlier article on leveraged ETFs: an idealized daily-reset 3× fund on an index with 10% expected annual return and 25% volatility, the default settings of the volatility simulator in that article. How likely is the fund to end the year down 90% or more, that is, worth less than a tenth of its starting value on the last day? (A path that dips below a tenth and then recovers does not count here; that is a different, path-dependent question.) Under this model the answer is about 0.105%, roughly once in 960 years. With plain simulation, ±10% needs about 370,000 simulated years. Three methods that reduce the noise:

  • Mirror pairs (antithetic variates). For every random path of daily shocks, also simulate its mirror image, every up day turned into a down day of the same size, and average the two. Lucky and unlucky draws partly cancel.
  • Control variate. Simulate alongside the fund a related quantity whose exact answer is known, and correct the estimate by how far that quantity missed in this run. Here the control is “the index itself had a very bad year”, whose probability follows exactly from the normal distribution. If the index happened to have too many bad years in this simulation, the fund’s crash count is adjusted down accordingly.
  • Importance sampling. Deliberately simulate a world where bad days are more common, so that crashes happen often, and then give each simulated year a weight equal to how likely it is in the real world divided by how likely it is in the tilted one. Crash paths, which the tilted world produces too often, get small weights, and the weighted count stays correct. Every run now contributes information about the crash, instead of one run in a thousand.
Figure 7. Error against computing time for the rare leveraged-fund crash. Lines: the expected 95% error from the measured variance and speed of each method; dots: the actual error of individual runs at several budgets. All methods improve at the same rate; they differ in where they start. Model: daily-reset 3× fund, normal daily returns, 10% drift, 25% volatility, no costs; reference probability 0.1046% from 10 million importance-sampling draws. Times are NumPy on a 4-core cloud machine; ratios travel better than seconds.

To reach ±10% with 95% confidence on this problem:

MethodVariance per run, relative to plainSpeed-up at equal accuracyTime for ±10%
Plain simulation11×about 2 s
Mirror pairs2.1× smaller per pairabout 1.4×about 1.4 s
Control variate11× smallerabout 11×about 0.17 s
Importance samplingabout 280× smallermore than 250×under 0.01 s

Importance sampling turned about 370,000 simulated years into about 1,350. That is the difference between a calculation you wait for and one you can run interactively, thousands of times, while varying the parameters.

These gains are specific to the problem. Mirror pairs help little here because a crash is a one-sided event: the mirror of a crash path is a boom path, which almost never crashes. A control variate is only as good as its correlation with the target. Importance sampling is the most powerful and the most dangerous: with a badly chosen tilt, a few runs receive enormous weights and the estimate becomes confidently wrong, with an error bar that understates the problem. It needs a check, such as comparing with plain simulation on an easier version of the same question.

Deeper look · optional mathematical depth

The three estimators in formulas

Each simulated year uses 252 daily shocks z1,…,z252z_1,\dots,z_{252}⁠, independent standard normal numbers. The underlying’s daily return is μ/252+σzt/252\mu/252+\sigma z_t/\sqrt{252} and the fund’s daily factor is 1+3×1+3\times that return. Let Y=1{fund ends below 0.1}Y=\mathbf 1\{\text{fund ends below }0.1\}⁠, so p=E[Y]p=\mathbb E[Y]⁠.

Mirror pairs average YY on the path zz and on −z-z⁠:

Y~=12(Y(z)+Y(−z))\tilde Y=\tfrac12\big(Y(z)+Y(-z)\big)

It has the same mean. Its variance is smaller when the two halves are negatively correlated.

Control variate. Let S=∑tztS=\sum_t z_t⁠, which is exactly normal with variance 252, and X=1{S<c}X=\mathbf 1\{S<c\}⁠, with cc chosen so that S<cS<c roughly corresponds to the crash. Then E[X]=Φ(c/252)\mathbb E[X]=\Phi(c/\sqrt{252}) is known exactly (Φ\Phi is the standard normal distribution function), and

Ycv=Y−b (X−E[X]),b=Cov(Y,X)Var(X)Y_{\text{cv}}=Y-b\,\big(X-\mathbb E[X]\big), \qquad b=\frac{\mathrm{Cov}(Y,X)}{\mathrm{Var}(X)}

has the same mean and variance (1−ρ2) Var(Y)(1-\rho^2)\,\mathrm{Var}(Y)⁠, where ρ\rho is the correlation of YY and XX⁠. Here ρ2≈0.91\rho^2\approx0.91⁠.

Importance sampling draws the shocks from a normal distribution with mean −θ-\theta instead of 0 and weights each year by the likelihood ratio

w=∏t=1252φ(zt)φ(zt+θ)=exp⁡ ⁣(θ∑t=1252zt+252 θ22)w=\prod_{t=1}^{252}\frac{\varphi(z_t)}{\varphi(z_t+\theta)}=\exp\!\Big(\theta\sum_{t=1}^{252}z_t+\frac{252\,\theta^2}{2}\Big)

where φ\varphi is the standard normal density and the ztz_t are the tilted draws. The estimator Y wY\,w has mean exactly pp⁠. Choosing θ\theta so that the tilted shock sum is centered on the crash threshold makes the crash happen in about half of the tilted runs.

A million runs of the wrong model

Everything above controls one kind of error: the randomness of the simulation itself. It does nothing about the other kind, the gap between the model and reality. In the withdrawal example, “draw each year independently from history” is a choice. Here are four reasonable alternatives for the same 152 years of data:

  • Years drawn independently, as above.
  • 10-year blocks of history, a block bootstrap: draw runs of 10 consecutive historical years, so that bad years that came in clusters stay together.
  • A normal model: log returns drawn from a normal distribution with the historical mean and standard deviation.
  • The actual history: the 123 real 30-year windows that start in 1871, 1872, …, 1993.
Figure 8. The same question under four models. The three simulated models use a million retirements each, so their 95% intervals (about ±0.05 percentage points) are barely visible. The historical windows overlap heavily, so their Wilson intervals, which assume independent observations, are too narrow and are shown only for orientation. Source: as Figure 1.

At a 4% withdrawal rate the three simulated models give 6.3%, 7.3% and 6.0%, and the actual history gives 3.3% (4 failures in 123 windows). The simulation error at a million runs is about ±0.05 percentage points; the disagreement between the models is more than 20 times larger, and the gap to history larger still.

Neither side is simply right. The block bootstrap keeps the clustering of bad years, so it fails more often than independent draws. The historical windows reflect the order in which returns actually came, including the tendency of strong decades to follow weak ones, but they overlap so much that they hold the information of only about five independent 30-year periods, of one country that turned out to be a historical winner (a form of survivorship bias at the level of whole markets). Real retirement studies also differ in fees, taxes, flexible spending and international data, all absent here.

The lesson for the title question: once the simulation error is clearly smaller than the model uncertainty, more runs buy nothing. A good use of the saved computing time is to rerun the simulation under several defensible models and report the range.

A short checklist

  1. Name the quantity and the precision before running: a probability, an average, a percentile, a difference; absolute or relative error; what confidence.
  2. Size the run with the formula, using a pilot estimate of the variability, and remember that the error shrinks only like 1/N1/\sqrt N⁠.
  3. For probabilities, count events: about 385 sightings for ±10%. Report an interval that does not collapse at zero.
  4. Compare on shared scenarios when the question is a difference.
  5. Do not stop because the interval looks narrow; stop on a rule fixed in advance.
  6. Reduce the variance before buying more runs, especially for rare events, and check the result with plain simulation where possible.
  7. Rerun with another seed, and rerun with another model. The first checks the arithmetic; the second checks the assumptions.

What this article does not cover

All the runs here are independent. Simulations whose runs depend on each other, such as Markov chain Monte Carlo (MCMC), need an extra step, the effective number of independent runs, and are a topic of their own, for example when testing investment strategies with many parameters. Quasi-Monte Carlo methods, which replace random numbers with evenly spread deterministic points and can beat the 1/N1/\sqrt N rate for smooth problems, are also left out, as are nested simulations and hardware questions.

Reproducibility

Every number and figure comes from the public companion repository dvirross/monte-carlo-sample-size: a small Python package (mcsize) with the confidence intervals and run-count formulas, the withdrawal model with its four scenario generators, the leveraged-fund model with the three variance-reduction estimators, and the stopping-rule experiment; a script that runs all experiments in about three minutes with fixed random seeds; the result tables; the figure code; a short walkthrough notebook; and 17 unit tests. The annual returns are rebuilt from the raw monthly Shiller file with a checksum, and the methodology document records the data construction, every model choice and the limitations.

Further reading

Monte Carlo error and variance reduction

  • Art B. Owen (2013), Monte Carlo Theory, Methods and Examples, freely available online. Chapters 8 (variance reduction, including antithetic sampling and control variates) and 9 (importance sampling) cover this article’s methods in depth.
  • Paul Glasserman (2003), Monte Carlo Methods in Financial Engineering, Springer (DOI 10.1007/978-0-387-21617-1). The standard reference for variance reduction and rare-event simulation in finance, including control variates and importance sampling for portfolio losses.
  • Søren Asmussen and Peter W. Glynn (2007), Stochastic Simulation: Algorithms and Analysis, Springer (DOI 10.1007/978-0-387-69033-9). A rigorous treatment of output analysis, sequential stopping and rare events.

Intervals for probabilities and stopping

  • Edwin B. Wilson (1927), “Probable inference, the law of succession, and statistical inference,” Journal of the American Statistical Association 22(158), 209–212 (DOI 10.1080/01621459.1927.10502953). The score interval that does not collapse at zero.
  • Lawrence D. Brown, T. Tony Cai and Anirban DasGupta (2001), “Interval estimation for a binomial proportion,” Statistical Science 16(2), 101–133 (DOI 10.1214/ss/1009213286). Why the textbook interval behaves poorly for small counts, and which intervals to use instead.
  • James A. Hanley and Abby Lippman-Hand (1983), “If nothing goes wrong, is everything all right? Interpreting zero numerators,” JAMA 249(13), 1743–1745 (DOI 10.1001/jama.1983.03330370053031). The rule of three.
  • J. B. S. Haldane (1945), “On a method of estimating frequencies,” Biometrika 33(3), 222–225 (DOI 10.2307/2332299). Inverse sampling: stop after a fixed number of events.

Withdrawal rates and historical returns

  • William P. Bengen (1994), “Determining withdrawal rates using historical data,” Journal of Financial Planning 7(4), 171–180. The origin of the “4% rule”, from rolling historical windows.
  • Robert J. Shiller, online data: the monthly US stock price, dividend, inflation and interest-rate series used here, from 1871.
  • Hans R. Künsch (1989), “The jackknife and the bootstrap for general stationary observations,” The Annals of Statistics 17(3), 1217–1241 (DOI 10.1214/aos/1176347265). The block bootstrap for dependent data.

Provenance

This article expands a LinkedIn post: