Tutorials › Exam ASTAM - Advanced Short-Term Actuarial Mathematics › Planning Simulations for Rare Events

Exam ASTAM · Simulation Precision and Design · Tutorial 652 of 979

Planning Simulations for Rare Events

Plan rare-event simulations around the number of events needed for useful precision, and interpret a zero-event result without treating the estimated probability as proof that the event is impossible.

Intermediate 10 min read

What You'll Learn

  • Represent each simulated rare event with an independent Bernoulli indicator.
  • Use expected event counts to assess whether a simulation is likely to observe any events.
  • Calculate simulation sizes for relative standard-error and confidence-interval targets.
  • Distinguish relative precision from absolute precision when the event probability is small.
  • Calculate an exact one-sided upper confidence limit after observing zero events.
  • Recognize when a normal approximation is unreliable for a rare-event estimate.

Why Rare Events Need Deliberate Simulation Planning

A simulation can generate many observations and still provide little information about a rare event. If the event probability is \(0.0002\), for example, 10,000 independent runs produce only two events on average. A simulation that observes zero or one event may be consistent with a range of probabilities, so the number of runs should be planned around the precision required—not chosen merely because it seems large.

This tutorial focuses on planning a fixed number of independent runs for a Bernoulli event. It uses expected event counts, relative error targets, and an upper confidence limit when no event is observed. The techniques are aligned with the SOA Exam ASTAM (Advanced Short-Term Actuarial Mathematics) syllabus.

Definition: Let \(I_j=1\) if the event occurs in simulation run \(j\), and \(I_j=0\) otherwise. Under independent, identically distributed runs with event probability \(p\), \(I_j\sim\operatorname{Bernoulli}(p)\). For \(n\) runs, the event count \(K=\sum_{j=1}^n I_j\) has a \(\operatorname{Binomial}(n,p)\) distribution, and the estimated event probability is \(\hat p=K/n\).

The assumptions matter: the runs must be independent, and each must represent the same event probability \(p\). If simulation outcomes are dependent or probabilities differ across runs, the binomial calculations below do not directly apply. The event probability is a model quantity; the simulation error discussed here is the variability in \(\hat p\) across repeated sets of runs.

Expected Counts and the Chance of Seeing No Events

The expected number of observed events is \(E[K]=np\). This is a useful first planning check, but it is not itself a precision guarantee. The probability of observing no events is

$$ P(K=0)=(1-p)^n. $$

For small \(p\), \((1-p)^n\) is approximately \(e^{-np}\). This approximation shows why expected counts are informative: when \(np\) is small, zero events are quite plausible; when \(np\) is larger, a zero-event outcome becomes less likely. For instance, about three expected events give roughly a 95% chance of at least one event, since \(e^{-3}\) is about \(0.05\). That is enough to make an event visible, but generally not enough for a stable probability estimate.

Worked Example: Planning for a Chance to Observe at Least One Event

A hypothetical simulation has a planned event probability of \(p=0.0001\). How many independent runs are needed for at least a 95% probability of observing one or more events?

Method. Set the probability of zero events to at most \(0.05\), then solve for \(n\):

$$ (1-p)^n\leq 0.05 \quad\Longrightarrow\quad n\geq \frac{\ln(0.05)}{\ln(1-p)}. $$

Substitute \(p=0.0001\). The denominator is \(\ln(0.9999)\), approximately \(-0.0001000050\), and the numerator is \(\ln(0.05)\), approximately \(-2.995732\). Therefore,

$$ n\geq \frac{-2.995732}{-0.0001000050} \approx 29{,}955.3. $$

The smallest whole-number run count that meets the requirement is \(n=29{,}956\). Its expected event count is \(np=2.9956\). The exact probability of at least one event is \(1-(0.9999)^{29{,}956}\), which is approximately \(0.9500\) to four decimal places.

Check and trap. Using \(np=1\) would give only about a 63.2% chance of at least one event, because \(1-e^{-1}\approx0.6321\). One expected event does not mean an event is virtually certain. The calculated run count meets the stated 95% visibility requirement; it does not, by itself, establish precise estimation.

Relative Precision for a Simulated Probability

For the Bernoulli estimator, \(E[\hat p]=p\) and \(\operatorname{Var}(\hat p)=p(1-p)/n\). Its standard error is therefore \(\sqrt{p(1-p)/n}\). Dividing this standard error by \(p\) gives the relative standard error, which measures uncertainty as a proportion of the probability being estimated.

$$ \operatorname{SE}(\hat p)=\sqrt{\frac{p(1-p)}{n}}, \qquad \frac{\operatorname{SE}(\hat p)}{p} =\sqrt{\frac{1-p}{np}}. $$

If a target relative standard error is \(r\), planning with a specified value of \(p\) requires

$$ \sqrt{\frac{1-p}{np}}\leq r \quad\Longrightarrow\quad n\geq \frac{1-p}{p r^2}. $$

For small \(p\), \(1-p\) is close to 1, so this is often approximated by \(n\geq 1/(p r^2)\). The expected event count at this approximate run size is about \(1/r^2\): a 10% relative standard error corresponds to roughly 100 expected events, while a 5% target corresponds to roughly 400.

Planning rule: For a Bernoulli event with planning probability \(p_0\), choose an integer run count at least \((1-p_0)/(p_0r^2)\) to target relative standard error \(r\). If the true probability is unknown, the calculation depends on the planning value; using a smaller plausible probability generally requires more runs.

Worked Example: Targeting a Relative Standard Error

A hypothetical portfolio simulation uses a planning event probability of \(p_0=0.0004\). Find the run count needed for a relative standard error no greater than 10%, and check the expected number of events.

Method. Set \(r=0.10\) and use the Bernoulli relative standard-error formula:

$$ n\geq \frac{1-p_0}{p_0r^2} =\frac{1-0.0004}{0.0004(0.10)^2} =\frac{0.9996}{0.000004} =249{,}900. $$

Thus, \(249{,}900\) runs meet the target under the planning probability. The expected event count is

$$ np_0=249{,}900(0.0004)=99.96. $$

The resulting relative standard error is \(\sqrt{0.9996/99.96}=\sqrt{0.01}=0.10\), exactly 10% under this calculation. The expected count is about 100, consistent with the small-\(p\) rule of thumb.

Check and trap. A common error is to use \(1/r^2=100\) as the number of runs. It is approximately the required number of expected events, not the number of simulation runs. At \(p_0=0.0004\), 100 runs would produce only \(0.04\) expected events. The run count must account for how rarely each event occurs.

Relative Confidence-Interval Width

A relative standard error target is not the same as a confidence-interval target. For a sufficiently well-behaved estimate, an approximate two-sided 95% normal interval is \(\hat p\pm1.96\operatorname{SE}(\hat p)\). Its approximate half-width relative to \(p\) is \(1.96\operatorname{SE}(\hat p)/p\). To plan for a relative half-width no greater than \(h\), use

$$ 1.96\sqrt{\frac{1-p}{np}}\leq h \quad\Longrightarrow\quad n\geq\frac{1.96^2(1-p)}{p h^2}. $$

This is a planning approximation, not a promise that every simulated interval will achieve the target. It uses a planning value for \(p\) and a normal approximation; that approximation can be poor when very few events are expected or observed. For small event counts, do not interpret a normal interval as reliable simply because the planned run count is large. The zero-event case requires particular care, as discussed below.

Worked Example: Planning a Relative 95% Margin

For a hypothetical event, use planning probability \(p_0=0.002\). Find the smallest run count that targets a 95% normal-approximation half-width of at most 20% of \(p_0\).

Method. Use \(h=0.20\), \(z=1.96\), and the planning probability:

$$ n\geq \frac{1.96^2(1-0.002)}{0.002(0.20)^2} = \frac{3.8416(0.998)}{0.00008} = \frac{3.8339168}{0.00008} =47{,}923.96. $$

Rounding upward gives \(n=47{,}924\) runs. The expected event count is \(47{,}924(0.002)=95.848\). The planned relative half-width is

$$ 1.96\sqrt{\frac{0.998}{95.848}} \approx 0.2000. $$

Thus, the planned normal-approximation half-width is about 20.00% of the event probability. The check confirms that the calculation targets the requested relative interval width, not a 20-percentage-point absolute width.

Check and trap. Using \(h=0.20\) as an absolute probability margin would answer a different question: it would allow an error of 0.20, vastly larger than \(p_0=0.002\). Relative width is the half-width divided by the probability being estimated.

Zero Observed Events: Report an Upper Limit

If \(K=0\), then \(\hat p=0\), but this does not show that the underlying probability is zero. A relative standard error calculated by dividing by \(\hat p\) is undefined, and a relative error target cannot be assessed from that estimate. Instead, report an upper confidence limit that reflects how large \(p\) could plausibly be given the zero-event outcome.

For a one-sided confidence level \(1-\alpha\), the exact binomial upper limit \(p_U\) after zero events is found by setting the probability of zero events equal to \(\alpha\):

$$ (1-p_U)^n=\alpha \quad\Longrightarrow\quad p_U=1-\alpha^{1/n}. $$

This is exact for independent Bernoulli runs with a fixed probability \(p\). For small \(p_U\), use \(\ln(1-p_U)\approx-p_U\) to obtain the useful approximation

$$ p_U\approx\frac{-\ln(\alpha)}{n}. $$

At 95% one-sided confidence, \(-\ln(0.05)\approx2.996\), giving the familiar rule of three, \(p_U\approx3/n\). The limit is an upper bound, not a point estimate. Its confidence interpretation is a repeated-sampling statement: this procedure covers the fixed probability at least \(1-\alpha\) of the time under the model assumptions.

Worked Example: Interpreting a Zero-Event Simulation

A hypothetical risk simulation runs \(n=20{,}000\) independent trials and observes no occurrences of a specified event. Calculate the exact one-sided 95% upper confidence limit and compare it with the rule of three.

Method. Substitute \(\alpha=0.05\) into the exact zero-event formula:

$$ p_U=1-0.05^{1/20{,}000} =1-\exp\left(\frac{\ln(0.05)}{20{,}000}\right). $$

Since \(\ln(0.05)/20{,}000=-0.0001497866\), the exponential is approximately \(0.9998502246\). Therefore,

$$ p_U\approx1-0.9998502246=0.0001497754. $$

To four significant figures, the exact upper limit is \(0.0001498\), or about 0.0150%. The rule-of-three approximation is \(3/20{,}000=0.0001500\), very close to the exact value.

Check and trap. Reporting \(\hat p=0\) as though the event were impossible is incorrect. The data contain no events, but the 95% upper limit still allows probabilities up to approximately \(0.0001498\). The rule of three is an approximation to the upper limit, not a replacement point estimate.

Putting the Planning Decisions Together

A useful planning sequence is to state the event and its probability scale, choose an initial planning value, specify the required precision or probability of observing events, and then check the expected count and the zero-event risk. Each calculation answers a different question:

1
Specify the target.
Decide whether the requirement is a chance of seeing at least one event, a relative standard error, or a relative confidence-interval half-width. These targets are not interchangeable.
2
Choose a planning probability.
Use a defensible value for \(p\). If it is uncertain, consider a smaller plausible value as a conservative planning choice for the required run count.
3
Calculate and round up.
Apply the formula for the selected target and round the resulting number of runs upward to an integer.
4
Check event counts and interpretation.
Calculate \(np\) and, where useful, \((1-p)^n\). If zero events actually occur, use a one-sided upper limit rather than claiming the probability is zero.

The main exam trap is to treat the expected event count as though it were a guarantee. The count \(np\) is an average over repeated simulations; it does not specify the count in a particular simulation. A related trap is to apply a normal relative-error calculation after observing zero events. Relative error around an estimate of zero is not meaningful, so use an upper confidence limit instead. These distinctions are especially important when a simulation budget is limited and an apparently large \(n\) may still yield only a few events.

Key takeaway: For rare-event Bernoulli simulation, plan in terms of both the event probability and the desired precision. Expected counts help diagnose whether events will appear; relative-error formulas size the simulation for estimation; and zero observations call for an upper confidence limit, not a declaration that the event cannot occur.

Check Your Understanding

For each problem, assume independent Bernoulli simulation runs and round run counts upward when required.

  1. A hypothetical event has planning probability \(p=0.0005\). Find the number of runs needed for a relative standard error no greater than 5%, and state the expected count at that run size. (Answer: \(n=799{,}600\); expected count \(399.8\).)
  2. For planning probability \(p=0.0012\), find the run count for a 95% normal-approximation relative half-width of 25%. Use \(z=1.96\). (Answer: \(n=51{,}160\).)
  3. A simulation observes zero events in \(10{,}000\) runs. Find the exact one-sided 90% upper confidence limit using \(p_U=1-0.10^{1/n}\). (Answer: \(p_U\approx0.0002302\).)
  4. A hypothetical event has planning probability \(p=0.0002\). Find the smallest run count giving at least a 99% chance of observing one or more events. (Answer: \(n=23{,}024\).)
  5. Zero events occur in \(5{,}000\) independent runs. Give the approximate one-sided 95% upper limit using the rule of three, and explain why the estimated probability of zero is not a proof of impossibility. (Answer: \(p_U\approx3/5{,}000=0.0006000\); zero observed events do not rule out a positive underlying probability.)
Clinical Biostats