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.
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
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\):
Substitute \(p=0.0001\). The denominator is \(\ln(0.9999)\), approximately \(-0.0001000050\), and the numerator is \(\ln(0.05)\), approximately \(-2.995732\). Therefore,
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.
If a target relative standard error is \(r\), planning with a specified value of \(p\) requires
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.
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:
Thus, \(249{,}900\) runs meet the target under the planning probability. The expected event count is
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
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:
Rounding upward gives \(n=47{,}924\) runs. The expected event count is \(47{,}924(0.002)=95.848\). The planned relative half-width is
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\):
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
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:
Since \(\ln(0.05)/20{,}000=-0.0001497866\), the exponential is approximately \(0.9998502246\). Therefore,
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:
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.
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.
Apply the formula for the selected target and round the resulting number of runs upward to an integer.
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.
Check Your Understanding
For each problem, assume independent Bernoulli simulation runs and round run counts upward when required.
- 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\).)
- 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\).)
- 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\).)
- 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\).)
- 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.)