Exact stochastic simulation of SIR dynamics — discrete individuals, random events
Exact SSA: Instead of discretizing time, draw (1) time to next event from Exp(λ_total) and (2) which event from multinomial weights.
Reactions:
S + I → 2I at rate β·S·I/N
I → R at rate γ·I
R₀ = β/γ = 3.00 — if R₀ > 1, epidemic can occur. But stochastic extinction is possible even when R₀ > 1.
Each colored line = one stochastic realization. Note variance between runs — absent in mean-field ODE. Final epidemic size varies substantially for finite N.