← Discrete-Time Markov Chains

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:

\[ \Pr(\text{eventual extinction})=1. \]

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

\[Z\ge H.\]

The epidemic reaches or exceeds the pre-specified size threshold.

Early fade-out

\[Z<H.\]

Infection becomes extinct before reaching the major-outbreak threshold.

Extinct by time \(T\)

\[I(T)=0.\]

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:

\[ Z<H \qquad\text{or}\qquad Z\ge H. \]

Therefore:

\[ \Pr(\text{early fade-out}) + \Pr(\text{major outbreak}) =1. \]

“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:

\[ H=20. \]

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.

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:

\[ Y_m= \begin{cases} 1,&Z_m\ge H,\\ 0,&Z_m<H. \end{cases} \]

The indicator turns a verbal event into data that can be counted. Its sample mean is the estimated probability:

\[ \widehat p = \frac{1}{M}\sum_{m=1}^{M}Y_m = \frac{\text{number of major outbreaks}}{M}. \]

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:

\[ \operatorname{SE}_{\mathrm{MC}}(\widehat p) = \sqrt{\frac{\widehat p(1-\widehat p)}{M}}. \]

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:

\[ \frac{1}{\sqrt{4M}} = \frac{1}{2\sqrt M}. \]

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:

\[ \text{centre} = \frac{\widehat p+z^2/(2M)}{1+z^2/M}, \] \[ \text{half-width} = \frac{z}{1+z^2/M} \sqrt{ \frac{\widehat p(1-\widehat p)}{M} + \frac{z^2}{4M^2} }. \]

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:

\[ N=100,\quad I_0=2,\quad \beta=0.3,\quad\gamma=0.1, \quad\Delta t=0.02\text{ day}. \]

Run \(M=1000\) trajectories up to 160 days. Define:

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.

Interactive PythonOutbreak probabilities and uncertainty

Output

Run the code to see the result.

Understand the new probability code

CodeMeaning
outcomes["final_size"] >= major_thresholdCreates 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_indicatorUses elementwise logical “or” to check that every completed outcome belongs to at least one category.
major_indicator & fadeout_indicatorUses 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

ColumnInterpretation
countNumber of simulations satisfying the event definition.
estimateCount divided by the total number of independent simulations.
MC standard errorEstimated numerical sampling variability of the Monte Carlo proportion.
95% lower/upperWilson 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

  1. Change seed = 31. Compare the new estimate with the original Wilson interval.
  2. Use only 100 simulations. Observe the wider intervals and more irregular running estimate.
  3. Increase the simulations to 2,000 if your browser can complete the calculation comfortably.
  4. Change major_threshold to 10, 30 or 40. State the changed event definition before interpreting the probability.
  5. Change time_cutoff from 20 to 10 and then 40 days. The extinction-by-time probability should be non-decreasing with the cutoff.
  6. Shorten max_days enough 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.