FC
Francesco Castaldi
Data Science

SIR Epidemiological Models as Markov Chains

DATE: 2025-06-10|READ TIME: 4 MINS|AUTHOR: FRANCESCO CASTALDI

> Key takeaways: Discrete models (Markov) allow real-time variations of parameters like lockdowns, unlike classic differential equations. Furthermore, Monte Carlo methods help quantify systemic uncertainty.

Markov transition matrix
FIG: Markov transition matrix

From Differential Equations to Discrete Steps

The classic SIR epidemiological model (Susceptible, Infected, Removed) makes massive use of continuous differential equations. Mathematically elegant, sure, but very unintuitive when you have to explain to policymakers the impact of a lockdown starting on a specific day.

Reality proceeds in discrete steps, not on perfectly smooth curves.

The Markovian Approach

Treating the SIR model as a Discrete-time Markov Chain, every single time "tick" corresponds to an exact day. Transition probabilities decide how many individuals move from one state to another. This allows inserting brutal and sudden variations to the parameters: for example, on day 15 the contact rate (R0) plummets because schools close.

[ TIP ]
Using Markov Chains greatly simplifies writing code in Python. You switch from complex differential solvers to simple matrix iterations.

Monte Carlo Analysis and Uncertainty

Pandemics are uncertain by definition. Using Monte Carlo simulation allows generating thousands of probabilistic scenarios instead of a single (and often wrong) deterministic prediction.

ParameterImpact on Markovian Model
R₀ (Basic Reproduction Rate)Defines the initial slope of the infected curve.
Recovery RateDetermines the emptying speed of the 'Infected' compartment.
External Interventions (Lockdown)Dynamically modifies transition matrices at run-time.

*Table 1: Parameters and Impact on the Markovian Model*

# Example of a Markovian transition matrix
import numpy as np

# States: S, I, R P = np.array([[0.95, 0.05, 0.00], [0.00, 0.90, 0.10], [0.00, 0.00, 1.00]]) `

Thanks to this Sensitivity Analysis, healthcare systems can mathematically understand if it makes sense to close flights or simply mandate mask usage, by analyzing the final probability distributions.

[ ← Back to Articles ][ Back to Home → ]
[ FC.SYS // ENG ]
GitHub|LinkedIn|Email
FRANCESCO CASTALDI © 2026