← Stochastic Differential Equations

12

Comparing deterministic, CTMC and SDE results

A fair comparison holds the biological rates, initial state and observation times fixed while recognising that the three approaches represent randomness differently.

Scenario and comparison question

Use an SIS infection in a population of \(N=200\), initially with \(I(0)=3\). All three models use \(\beta=0.25\) and \(\gamma=0.15\) per day and are compared over the same 60-day period.

The comparison asks three separate questions:

  1. How does the deterministic prevalence path compare with stochastic ensemble means?
  2. How wide are the CTMC and SDE outcome distributions?
  3. How similarly do the stochastic models represent the disease-free boundary?

One biology, three mathematical descriptions

ApproachState and pathMain information
Deterministic ODEContinuous, one smooth pathAverage-direction reference
CTMCInteger, piecewise-constant jumps at random timesDiscrete events and extinction
SDEContinuous, irregular diffusion pathApproximate continuous fluctuations

The parameter values and biological rates must match before outcomes are compared.

Shared SIS drift

\[f(I)=\beta\frac{(N-I)I}{N}-\gamma I.\]

The deterministic model uses \(dI=f(I)dt\). The CTMC uses infection and recovery events separately. The SDE uses the same drift and diffusion \(g(I)=\sqrt{a_1(I)+a_2(I)}\).

Requirements for a fair comparison

Must matchWhy
Population and initial stateDifferent starting risks produce different outcomes.
Infection and recovery rate formulasThe models must represent the same biological mechanisms.
Parameter values and unitsA per-day rate cannot be compared with a per-week rate.
Observation timesOutcomes must refer to the same dates.
Boundary and stopping definitionsExtinction must mean the same biological event.

Numerical choices such as Euler–Maruyama \(\Delta t\) must also be reported, even though the CTMC does not use that fixed step.

Interactive Python laboratory

Interactive PythonDeterministic, CTMC and SDE comparison

Output

Run the code to see the result.

Why the stochastic mean need not equal the deterministic path

The SIS drift is nonlinear because it contains \(I^2\). In general,

\[\mathbb E[f(I)]\ne f(\mathbb E[I]).\]

The deterministic equation evaluates the drift at one deterministic state. The stochastic mean depends on the full distribution, including variance and extinction. Therefore, matching biological rates does not require the deterministic path and stochastic ensemble mean to be identical.

How to interpret agreement

The deterministic path is not expected to equal every stochastic path. Agreement is assessed through ensemble summaries. For sufficiently large populations away from boundaries, the SDE distribution may approximate the CTMC distribution. Near extinction and small counts, discrepancies can be important.

When is the SDE approximation useful?

The diffusion approximation is generally most plausible when event rates and population counts are sufficiently large, changes of one individual are small relative to the population scale, and trajectories remain away from absorbing boundaries.

It becomes less reliable when infectious counts are small, extinction probability is central, discrete superspreading events matter, or the numerical method frequently corrects invalid states. In those cases, the CTMC provides a more direct event-level description.

Do not claim that one model is universally better

What this lesson adds

You can now compare three models under matched assumptions, align their outputs on common times, distinguish path agreement from distributional agreement, and explain why extinction boundaries challenge diffusion approximations.