13
Extinction and major-outbreak probabilities
Monte Carlo simulation becomes scientifically meaningful only after outcomes are defined precisely. We now define early fade-out, major outbreak and extinction by a chosen time, then estimate their probabilities and simulation uncertainty.
Why “extinction probability” is ambiguous
In a closed SIR model with no births or imported infections, every completed epidemic eventually reaches \(I=0\). Therefore:
This fact does not distinguish an introduction that disappears after infecting two people from an outbreak that infects most of the population and then ends.
Always specify whether “extinction” means eventual extinction, extinction before a threshold is reached, or extinction by a stated time.
Define the outcomes before running the simulations
Let \(Z\) be the completed epidemic size—the total number of people infected, including those infectious initially. Choose a major-outbreak threshold \(H\).
Major outbreak
The epidemic reaches or exceeds the pre-specified size threshold.
Early fade-out
Infection becomes extinct before reaching the major-outbreak threshold.
Extinct by time \(T\)
The absorbing extinction state has been reached no later than the stated time.
Which events form a partition?
For a completed closed SIR trajectory, exactly one of these is true:
Therefore:
“Extinct by day 20” is a different time-specific event. It may overlap with early fade-out, and it is not the complement of major outbreak.
Choosing the major-outbreak threshold
In the worked example, \(N=100\) and:
A major outbreak is therefore defined as at least 20 people infected, or 20% of the population.
This threshold is illustrative. In an applied study, it might be based on hospital demand, public-health workload, a percentage of the population, or a scientifically justified outbreak definition.
- Choose the threshold before examining the simulated results.
- State whether the threshold concerns final size, peak size, cumulative cases or another quantity.
- Report sensitivity to reasonable alternative thresholds.
Changing \(H\) changes the event being measured, so it can change the estimated probability even when the epidemic model is unchanged.
Convert simulated outcomes into indicators
For simulation \(m\), define the major-outbreak indicator:
The indicator turns a verbal event into data that can be counted. Its sample mean is the estimated probability:
The early-fade-out and time-specific extinction indicators are constructed in the same way.
Monte Carlo uncertainty
Repeating the entire experiment with another seed generally gives a slightly different estimate. This sampling variation is measured by the Monte Carlo standard error:
Biological uncertainty
The model assigns multiple possible epidemic outcomes even when parameters are fixed.
Monte Carlo uncertainty
A finite number of simulations estimates the model probability imperfectly.
Running more simulations reduces Monte Carlo uncertainty but does not remove the stochastic variability inherent in the epidemic model.
Why four times as many runs halve the standard error
The standard error is proportional to \(1/\sqrt M\). If \(M\) is multiplied by 4:
Thus approximately four times as much simulation work is required to halve the Monte Carlo standard error.
A 95% interval for a simulated probability
The code reports a Wilson 95% interval. It is designed for a binomial proportion and behaves better than the simple \(\widehat p\pm1.96\operatorname{SE}\) interval when probabilities are near 0 or 1 or the simulation count is modest.
For \(x\) successes among \(M\) simulations and \(z=1.96\), the Wilson centre and half-width are:
This interval describes numerical uncertainty from a finite Monte Carlo sample under the chosen model. It does not include uncertainty in \(\beta\), \(\gamma\), initial conditions or model assumptions.
Worked scenario
Use the same SIR model as Lesson 12:
Run \(M=1000\) trajectories up to 160 days. Define:
- major outbreak: \(Z\ge20\);
- early fade-out: \(Z<20\); and
- extinct by day 20: extinction time \(\le20\) days.
Interactive Python laboratory
Click Run code to simulate the outcomes, estimate the three probabilities, calculate Monte Carlo uncertainty and examine sensitivity to the major-outbreak threshold.
Output
Run the code to see the result.
Understand the new probability code
| Code | Meaning |
|---|---|
outcomes["final_size"] >= major_threshold | Creates one Boolean major-outbreak indicator per simulation. |
indicator.sum() | Counts True values because Python treats True as 1. |
indicator.mean() | Calculates the proportion of True values—the Monte Carlo probability estimate. |
major_indicator | fadeout_indicator | Uses elementwise logical “or” to check that every completed outcome belongs to at least one category. |
major_indicator & fadeout_indicator | Uses elementwise logical “and” to check that the categories do not overlap. |
np.cumsum(...) | Calculates cumulative successes after 1, 2, 3, and later simulations. |
yerr=[lower_errors, upper_errors] | Adds possibly unequal lower and upper Wilson interval lengths to the bar chart. |
Read the probability table correctly
| Column | Interpretation |
|---|---|
count | Number of simulations satisfying the event definition. |
estimate | Count divided by the total number of independent simulations. |
MC standard error | Estimated numerical sampling variability of the Monte Carlo proportion. |
95% lower/upper | Wilson interval endpoints for the model probability. |
Report the event definition, number of simulations, estimate and uncertainty together. A bare probability without its definition or simulation count is incomplete.
Why incomplete paths must not be silently classified
If the horizon is reached while \(I>0\) and the current final size is below \(H\), the path might cross the threshold later. Calling it an early fade-out would be wrong.
The code therefore stops with an error if any trajectory is incomplete. Other defensible approaches include extending the horizon or reporting an explicit unclassified/censored category.
Interpret threshold sensitivity
As \(H\) increases, the event \(\{Z\ge H\}\) becomes more demanding. Therefore its probability cannot increase.
If conclusions change strongly across reasonable thresholds, report that sensitivity rather than presenting one threshold as uniquely correct.
Interpret the running estimate
The first few simulations can make the running probability jump substantially. Each additional trajectory has less influence as the accumulated sample grows.
Stabilisation is evidence about Monte Carlo precision, not proof that the epidemic model is biologically correct. A precisely simulated poor model remains a poor model.
Try these experiments
- Change
seed = 31. Compare the new estimate with the original Wilson interval. - Use only 100 simulations. Observe the wider intervals and more irregular running estimate.
- Increase the simulations to 2,000 if your browser can complete the calculation comfortably.
- Change
major_thresholdto 10, 30 or 40. State the changed event definition before interpreting the probability. - Change
time_cutofffrom 20 to 10 and then 40 days. The extinction-by-time probability should be non-decreasing with the cutoff. - Shorten
max_daysenough to produce incomplete paths and read the protective error message.
Biological interpretation
The major-outbreak estimate describes how frequently the model crosses a specified public-health-relevant size under fixed parameters and initial conditions. The early-fade-out estimate describes failure to reach that size because stochastic recovery and transmission events unfold differently across introductions.
These are conditional model probabilities. They change if parameters, population size, starting infections, time step, intervention assumptions or outcome definitions change.
What this lesson has added
- Event definitions are fixed before probability estimation.
- Early fade-out and major outbreak partition completed final-size outcomes.
- Extinction by a stated time is a separate event.
- Boolean indicators convert definitions into countable simulation data.
- Monte Carlo standard error measures finite-simulation uncertainty.
- Wilson intervals quantify uncertainty in estimated event probabilities.
- Threshold sensitivity reveals dependence on the operational outbreak definition.
- Incomplete trajectories must be extended or explicitly treated as unclassified.
Lesson 14 completes the DTMC pathway by choosing appropriate graphs, tables and written interpretations for trajectories, distributions and probability estimates.