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:
- How does the deterministic prevalence path compare with stochastic ensemble means?
- How wide are the CTMC and SDE outcome distributions?
- How similarly do the stochastic models represent the disease-free boundary?
One biology, three mathematical descriptions
| Approach | State and path | Main information |
|---|---|---|
| Deterministic ODE | Continuous, one smooth path | Average-direction reference |
| CTMC | Integer, piecewise-constant jumps at random times | Discrete events and extinction |
| SDE | Continuous, irregular diffusion path | Approximate continuous fluctuations |
The parameter values and biological rates must match before outcomes are compared.
Shared SIS drift
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 match | Why |
|---|---|
| Population and initial state | Different starting risks produce different outcomes. |
| Infection and recovery rate formulas | The models must represent the same biological mechanisms. |
| Parameter values and units | A per-day rate cannot be compared with a per-week rate. |
| Observation times | Outcomes must refer to the same dates. |
| Boundary and stopping definitions | Extinction 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
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,
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
- Use the ODE for a fast average-direction baseline.
- Use the CTMC when integer events, exact absorption or small populations matter.
- Use the SDE when continuous fluctuation is a useful and efficient approximation.
- Model choice depends on the biological question, scale and required outcomes.
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.