= Solution
For the <stochastic SIR model>, the state $(S,I,R)$ is a <continuous-time Markov chain> on nonnegative integer triples summing to $N+1$, initially $(N,1,0)$. Its only transitions are
$$
\boxed{(s,i,r)\longrightarrow(s-1,i+1,r)\text{ at rate }\beta si,\qquad(s,i,r)\longrightarrow(s,i-1,r+1)\text{ at rate }\gamma i.}
$$
Rates vanish when a proposed transition would leave the state space. Equivalently, with independent unit-rate <Poisson processes> $A,B$, the <Poisson time-change representation of a Markov chain> is
$$
S(t)=N-A\left(\int_0^t\beta S(u-)I(u-)\,du\right),\quad R(t)=B\left(\int_0^t\gamma I(u-)\,du\right),\quad I(t)=N+1-S(t)-R(t).
$$
The left limits describe the state immediately before each jump. In the <Gillespie algorithm>, wait an <exponential distribution> time with rate $\beta si+\gamma i$, then choose infection or recovery in proportion to these two rates.
Back to article page