Skip to content
All library documents

Monte Carlo Stopping Rules Based on Confidence Interval Width

Article Quant Q&A · Author: Kritz

Summary

The document discusses stopping a Monte Carlo valuation of a European option when the estimate is sufficiently precise. The proposed criterion compares a confidence-interval half-width, estimated as a normal critical value times the sample standard error, with a tolerance. For an absolute tolerance, the answer recommends using the sample standard deviation and continuing until the estimated half-width falls below the specified amount.

The responses caution that a relative error criterion depends on the unknown true mean, and that a sample with no rare events can have an artificially small estimated variance and trigger premature stopping. The central-limit approximation also requires enough observations and may be unreliable for heavy tails or rare-event payoffs; importance sampling is mentioned as a possible concern. Online updates to the sample mean and variance avoid repeatedly recomputing statistics. The method is approximate, and repeatedly checking a fixed confidence bound while sampling can affect nominal coverage.

Key ideas

  • A Monte Carlo estimate can be monitored through an estimated confidence-interval half-width.
  • For an absolute error tolerance, compare the normal critical value times sample standard error with that tolerance.
  • A relative error check based on the true mean is impractical because the mean is unknown.
  • Rare events may not appear in early samples, making estimated variance misleadingly small.
  • Online mean and variance updates reduce the cost of repeatedly evaluating a stopping condition.

Tags

Full text
# Stopping Monte Carlo simulation once certain convergence level is reached


# Stopping Monte Carlo simulation once certain convergence level is reached












I'm creating a Monte Carlo simulation model which I use to price an European option with various pay-off conditions, hence I can't use Black Scholes.

I want to stop the simulation once I am 95% sure I am within 1% of the true value.

To do this, I calculate the relative error (correct naming?) every 10 000 sims using:

$$Relative Error = \frac{(\sigma/\sqrt{n}) Z_{\delta/2}}{\mu} $$

Where $$\sigma/\sqrt{n}$$ represent the standard error and $$Z_{\delta/2}$$ my confidence level, so 1.96 for 95%.

μ is the mean (fair value) of the simulation.

If the relative error is less than let's say 1%, then I stop the simulation.

Is this the correct way of solving my problem?

## Answer by Brian B (score 1, accepted)

https://quant.stackexchange.com/a/21767

Yes, that's an excellent approach. The only time it might go wrong is if, say, you are integrating on some extreme tail event without using importance sampling.

For example, let's say you were simulating expected loss on a portfolio of five bonds issued by the USA, Germany, Norway, Sweden and the Netherlands. After 10,000 simulations, there's a chance you might still not have generated any paths with defaults, in which case $\sigma=0$ and your algorithm would halt.

## Answer by bcf (score 9)

https://quant.stackexchange.com/a/21769

You have the right idea, but it seems you don't know $\mu$, so using it in your error check doesn't seem correct. Also, checking the result every 10,000 iterations may not be optimal for deciding when to stop.

To be clear, let $E(X) = \mu$ and $Var(X) = \sigma$. We're invoking the CLT when we write $$ P\left( \left|\frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}}\right| > 1.96 \right) \approx P(|Z| > 1.96) = 0.05. $$ In words, there is approximately a 95% probability that the sample mean $\bar{X}_n$ is within $1.96\frac{\sigma}{\sqrt{n}}$ units of the true mean $\mu$.

How do we use this in simulation? First, note $$ S_n^2 := \frac{1}{n-1}\sum_{i=1}^n (X_i - \bar{X})^2 $$ is an unbiased estimator of $\sigma^2$. Thus if we want an approximate 95% probability that $\bar{X}_n$ is within $0.01$ units of $\mu$, we continue simulation until $$ 1.96\frac{S_n}{\sqrt{n}} < 0.01. $$

There are two important items to note:

- We should have $n \geq 30$ to use this error check since this is a result of the CLT, and

- An online implementation of $\bar{X}_n$ and $S_n^2$ would be much more efficient, so that we don't recompute them every time.

For item 2, we may use \begin{align} \bar{X}_{n+1} & = \bar{X}_n + \frac{X_{n+1} - \bar{X}_n}{n+1}, \\ S^2_{n+1} & = \left(1 - \frac{1}{n}\right)S_n^2 + (n+1)(\bar{X}_{n+1} - \bar{X}_n)^2 \end{align} Now we may simply use a `while`($1.96\frac{S_n}{\sqrt{n}} > 0.01$) loop, stopping at exactly the iteration this error is met.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.