Tutorials › Stochastic Processes › Transition Rates in a Stochastic SIR Epidemic

Stochastic Models in Biology, Finance and Epidemics · Tutorial 965 of 994

Transition Rates in a Stochastic SIR Epidemic

Learn how SIR population counts determine continuous-time transition rates and how those rates give exact probabilities for the next infection or recovery.

Intermediate 10 min read

What You'll Learn

  • Define the finite state space for a closed-population stochastic SIR process.
  • Derive infection and recovery rates from the assumed contact and recovery mechanisms.
  • Construct generator entries and verify that each row sums to zero.
  • Compute the next-event type probabilities and waiting-time distribution.
  • Handle states with no infectious people or no susceptible people.

From Population Counts to Event Rates

A stochastic SIR model describes random changes in the numbers of susceptible, infectious, and removed people. Its state records those counts, while its transition rates specify how quickly infection and recovery events occur. Once the rates are known at the current state, competing exponential waiting times give the probability that each kind of event happens next. This tutorial focuses on that state-by-state calculation; it does not require an approximation for the early epidemic.

Consider a closed population of fixed size \(N\). Each person is in exactly one of three classes: susceptible, infectious, or removed. Removed people have recovered or otherwise left the infectious population and do not become susceptible again. On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), let \(X_t=(S_t,I_t,R_t)\), \(t\ge0\), be a continuous-time Markov chain with state space \(D_N=\{(s,i,r):s,i,r\text{ are nonnegative integers and }s+i+r=N\}\). We use the natural filtration \(\mathcal{F}_t=\sigma(X_u:0\le u\le t)\). The model assumes that, conditional on the current state, the rates of the next infection and recovery depend only on that state.

For the infection mechanism, suppose each infectious person makes contacts at rate \(c\), each contact transmits infection with probability \(p\), and a contacted person is chosen uniformly from the \(N\) people. Define \(\beta=cp\). With \(i\) infectious people, the total rate of contacts that successfully reach a susceptible person is \(\beta i(s/N)\). For recovery, assume that each infectious person recovers at rate \(\gamma\), independently of the others. The total recovery rate is therefore \(\gamma i\).

Definition: At state \(x=(s,i,r)\), an infection changes the state to \((s-1,i+1,r)\) and has rate \(\lambda(s,i,r)=\beta si/N\). A recovery changes the state to \((s,i,r+1)\) and has rate \(\mu(s,i,r)=\gamma i\). All other one-event transition rates are zero. The parameters \(\beta\) and \(\gamma\) are nonnegative; the state changes are possible only when their corresponding rates are positive.

The factor \(s/N\) is the probability that a uniformly selected contact is susceptible. Thus infection requires both \(s>0\) and \(i>0\). Recovery requires \(i>0\). The count \(r\) does not directly enter either rate, but it is part of the state and enforces the fixed-population constraint. Another common model uses an infection rate proportional to \(si\) without division by \(N\); that is a different parameterization, and its rate parameter should not be silently substituted for \(\beta\) here.

The Generator and Its Row Sums

For a continuous-time Markov chain, the generator records the instantaneous transition rates. Write \(q_{xy}\) for the generator entry from state \(x\) to state \(y\), and \(Q=(q_{xy})\). For distinct states \(x,y\), the entry is the rate of a direct one-event transition from \(x\) to \(y\). The diagonal entry is minus the total rate of leaving \(x\). For the SIR model, set \(a(s,i,r)=\lambda(s,i,r)+\mu(s,i,r)\). Then \(q_{x,x}=-a(x)\), and the only possible nonzero off-diagonal entries are \(q_{x,(s-1,i+1,r)}=\lambda(x)\) and \(q_{x,(s,i-1,r+1)}=\mu(x)\), when those transitions are possible.

Result (generator row sums): For every state \(x\in D_N\), the SIR generator row sums to zero. If \(a(x)>0\), the diagonal entry is \(-a(x)\) and the off-diagonal entries sum to \(a(x)\). If \(a(x)=0\), the entire row is zero.

Proof. Fix \(x=(s,i,r)\). The only possible off-diagonal transitions are infection and recovery, so their rates sum to \(\lambda(x)+\mu(x)=a(x)\); a transition whose rate is zero contributes nothing. The diagonal is defined to be \(-a(x)\). Therefore the row sum is \(-a(x)+\lambda(x)+\mu(x)=0\). If \(a(x)=0\), nonnegativity of both rates implies \(\lambda(x)=\mu(x)=0\), so the diagonal and every off-diagonal entry are zero. \(\square\)

This rule is useful both for constructing the generator and for checking arithmetic. A negative diagonal is not an additional event: it balances the rates of leaving the state. A state with no possible infection or recovery is absorbing, and its generator row is all zero.

Which Event Happens Next?

At a fixed state \(x\), write \(\lambda=\lambda(x)\), \(\mu=\mu(x)\), and \(a=\lambda+\mu\). Under the continuous-time Markov model, the infection and recovery clocks are exponential with their respective rates. When a rate is zero, its clock never rings. The next-event time is the first ring of the clocks that have positive rates. The following calculation gives both the waiting-time distribution and the event type probabilities.

Theorem (Competing SIR event rates): Conditional on \(X_t=x\) and \(a(x)>0\), the waiting time \(W\) until the next state change has exponential distribution with rate \(a(x)\), so \(\mathbb{P}(W>u\mid X_t=x)=e^{-a(x)u}\) for \(u\ge0\). The probability that the next event is infection is \(\lambda(x)/a(x)\), and the probability it is recovery is \(\mu(x)/a(x)\). For \(h\ge0\), the probability that an infection is the first event and occurs within the next \(h\) time units is \(\frac{\lambda(x)}{a(x)}(1-e^{-a(x)h})\); the corresponding recovery probability is \(\frac{\mu(x)}{a(x)}(1-e^{-a(x)h})\). If \(a(x)=0\), no event occurs and the waiting time is infinite.

Proof. Suppose first that \(a>0\). Let \(W_I\) and \(W_R\) be the infection and recovery clock times. For \(u\ge0\), independence and the exponential survival probabilities give \(\mathbb{P}(W>u)=\mathbb{P}(W_I>u,W_R>u)=e^{-\lambda u}e^{-\mu u}=e^{-au}\). A zero-rate clock has survival probability one, so the same calculation covers \(\lambda=0\) or \(\mu=0\). For \(t\ge0\), the density that infection is the first event at time \(t\) is the infection-clock density \(\lambda e^{-\lambda t}\) multiplied by the probability that the recovery clock has not rung, \(e^{-\mu t}\). It is therefore \(\lambda e^{-at}\). Integrating over all \(t\ge0\) gives \(\int_0^\infty\lambda e^{-at}\,dt=\lambda/a\); integrating from \(0\) to \(h\) gives \(\lambda(1-e^{-ah})/a\). Replacing \(\lambda\) by \(\mu\) gives the recovery formulas. These two event probabilities sum to one because \((\lambda+\mu)/a=1\). If \(a=0\), nonnegativity implies both rates are zero, so neither clock rings. \(\square\)

In particular, the chance of any event in the next \(h\) time units is \(1-e^{-ah}\) when \(a>0\), and the remaining probability \(e^{-ah}\) is the chance that the state has not changed. Conditional on an event occurring within that interval, the event-type probabilities are still \(\lambda/a\) and \(\mu/a\): dividing each first-event-within-\(h\) probability by \(1-e^{-ah}\) gives those ratios when \(h>0\). If \(h=0\), the conditioning event has probability zero, so that conditional statement is not defined.

Worked Example: Infection and Recovery at a Given State

Let \(N=10\), \(\beta=\tfrac12\), and \(\gamma=\tfrac14\). Suppose the current state is \(x=(7,2,1)\). Find the infection and recovery rates, the probabilities of the two possible next events, and the mean waiting time to the next event.

The population count check is \(7+2+1=10\). The infection rate is \(\lambda(x)=\tfrac12\cdot7\cdot2/10=\tfrac7{10}\). The recovery rate is \(\mu(x)=\tfrac14\cdot2=\tfrac12\). Thus \(a(x)=\tfrac7{10}+\tfrac12=\tfrac{12}{10}=\tfrac65\), which is positive. The next-event probabilities are \(\mathbb{P}(\text{infection next}\mid X_t=x)=(\tfrac7{10})/(\tfrac65)=\tfrac7{12}\) and \(\mathbb{P}(\text{recovery next}\mid X_t=x)=(\tfrac12)/(\tfrac65)=\tfrac5{12}\). The mean of an exponential waiting time with rate \(\tfrac65\) is \(1/(\tfrac65)=\tfrac56\).

The infection destination is \((6,3,1)\), and the recovery destination is \((7,1,2)\). In the generator row for \(x\), the diagonal is \(-\tfrac65\), the infection entry is \(\tfrac7{10}\), and the recovery entry is \(\tfrac12\). The row sum check is \(-\tfrac65+\tfrac7{10}+\tfrac12=-\tfrac{12}{10}+\tfrac7{10}+\tfrac5{10}=0\). The event probability check is \(\tfrac7{12}+\tfrac5{12}=1\).

Worked Example: Probabilities Within a Fixed Time Window

Use \(N=6\), \(\beta=\tfrac34\), and \(\gamma=\tfrac13\) at state \(x=(4,2,0)\). Calculate the probability that infection is the first event within a time interval of length \(h\), where \(h=\tfrac35\ln 2\). Also find the probability that no event occurs during that interval.

The state counts sum to \(4+2+0=6\). The infection rate is \(\lambda(x)=\tfrac34\cdot4\cdot2/6=1\), while the recovery rate is \(\mu(x)=\tfrac13\cdot2=\tfrac23\). Hence \(a(x)=1+\tfrac23=\tfrac53\). Substituting the specified interval length gives \(a(x)h=\tfrac53\cdot\tfrac35\ln2=\ln2\), so \(e^{-a(x)h}=e^{-\ln2}=\tfrac12\).

The probability that infection is first and occurs within the interval is \(\frac{1}{5/3}(1-\tfrac12)=\tfrac35\cdot\tfrac12=\tfrac3{10}\). The probability that recovery is first and occurs within the interval is \(\frac{2/3}{5/3}(1-\tfrac12)=\tfrac25\cdot\tfrac12=\tfrac15\). The probability of no event is \(\tfrac12\). These probabilities sum to \(\tfrac3{10}+\tfrac15+\tfrac12=\tfrac3{10}+\tfrac2{10}+\tfrac5{10}=1\).

The generator row has diagonal \(-\tfrac53\), infection entry \(1\), and recovery entry \(\tfrac23\). Its row sum is \(-\tfrac53+1+\tfrac23=0\), independently checking the total rate used in the time-window calculation.

Worked Example: A State with No Susceptible People

Let \(N=5\), \(\beta=\tfrac25\), and \(\gamma=\tfrac16\), and suppose \(x=(0,2,3)\). Find the next-event probabilities and waiting-time mean, and identify the generator row.

The counts satisfy \(0+2+3=5\). Because \(s=0\), the infection rate is \(\lambda(x)=\tfrac25\cdot0\cdot2/5=0\). The recovery rate is \(\mu(x)=\tfrac16\cdot2=\tfrac13\), so \(a(x)=0+\tfrac13=\tfrac13\). Therefore recovery is the next event with probability \((\tfrac13)/(\tfrac13)=1\), infection is next with probability \(0/(\tfrac13)=0\), and the mean waiting time is \(1/(\tfrac13)=3\).

The only off-diagonal entry in this row is \(q_{(0,2,3),(0,1,4)}=\tfrac13\), and the diagonal entry is \(-\tfrac13\). The row sum is \(-\tfrac13+\tfrac13=0\). After the recovery, one infectious person remains, so the process is not yet absorbing. By contrast, if \(i=0\), both rates are zero regardless of \(s\) and \(r\), and that state is absorbing in this model.

Common Mistakes and Model Checks

A frequent error is to use \(\beta i\) as the infection rate, counting contacts made by infectious people without accounting for the chance that a contact reaches a susceptible person. In the first example, that incorrect calculation would give \(\tfrac12\cdot2=1\), rather than the correct rate \(\tfrac12\cdot2\cdot(7/10)=\tfrac7{10}\). It would then produce the incorrect total rate \(1+\tfrac12=\tfrac32\) and the incorrect infection-next probability \(1/(\tfrac32)=\tfrac23\). The correction is to include the susceptible fraction \(s/N\) under the stated uniform-contact mechanism.

Other checks help catch errors before using the probabilities:

  • Confirm \(s+i+r=N\) in every state and ensure each event destination preserves that sum.
  • Calculate both event rates separately before adding them to obtain the total rate.
  • Check that event-type probabilities add to one when the total rate is positive.
  • Check the generator row by adding its negative diagonal to all off-diagonal rates.
  • Handle zero rates directly: when \(a=0\), ratios with denominator \(a\) are not used; the process has no next event.

The state-dependent rates are the basic local description of this stochastic epidemic model. They determine the waiting time and next transition without saying that the trajectory is stationary: the rates generally change as the counts change. They also make the boundary behavior explicit. With no infectious people, there can be neither new infections nor recoveries; with no susceptible people but some infectious people, only recovery events remain possible.

Check Your Understanding

For each question, use the stated frequency-dependent infection rate and show the rate and probability calculations.

  1. For \(N=8\), \(\beta=\tfrac12\), \(\gamma=\tfrac14\), and state \((5,2,1)\), find both event rates and the probability that recovery occurs next.
  2. At a state with infection rate \(\lambda=\tfrac34\) and recovery rate \(\mu=\tfrac14\), what is the probability of no event by time \(h=1\)?
  3. For state \((0,3,2)\) with \(\gamma=\tfrac13\), explain why the next event must be recovery and calculate its rate.
  4. Write the nonzero entries of the generator row when \(\lambda=\tfrac25\) and \(\mu=\tfrac35\), including the diagonal, and verify its row sum.
  5. Explain why the event-type probabilities are undefined when both rates are zero, and describe what the process does in that state.