Stochastic Epidemic — Gillespie SSA

Exact stochastic simulation of SIR dynamics using the Gillespie algorithm (SSA). Each event (infection or recovery) is drawn from the exact waiting-time distribution — no time-step approximation. Multiple trajectories show stochastic variability around the mean-field ODE.

S(t)
I(t)
R(t)
Mean-field I(t)
R₀ = β/γ = —
Peak I: —
Final R: —