Tutorials › Stochastic Processes › Likelihood From Infection and Recovery Event Histories

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

Likelihood From Infection and Recovery Event Histories

Learn to turn a complete SIR event history into a likelihood and estimate its transmission and recovery parameters.

Intermediate 12 min read

What You'll Learn

  • Write the infection and recovery transition rates for a finite-population SIR process.
  • Derive the path likelihood from event rates and the probability of no event between observed events.
  • Summarize infection and recovery histories using event counts and integrated exposures.
  • Obtain maximum-likelihood estimates of transmission and recovery rates.
  • Recognize when a likelihood has a boundary maximum or an uninformative exposure.

From an Observed Epidemic Path to a Likelihood

When infection and recovery times are observed, the data contain more than the final number of cases. Each event identifies which transition occurred, and each interval without an event tells us that the process avoided all possible transitions during that time. A continuous-time likelihood must account for both pieces. The resulting formula has a useful structure: event counts multiply the rates, while the time spent at risk appears through integrated rates.

Fix a population size \(N\). On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), let \((X_t)_{t\ge0}\), with \(X_t=(S_t,I_t,R_t)\), be a continuous-time Markov chain on \( \mathcal{S}=\{(s,i,r):s,i,r\text{ are nonnegative integers and }s+i+r=N\}\). Use its natural filtration \((\mathcal{F}_t)_{t\ge0}\), the information generated by the process through time \(t\). The infection and recovery transitions are \((s,i,r)\to(s-1,i+1,r)\) and \((s,i,r)\to(s,i-1,r+1)\), respectively. Their rates are \(\beta si/N\) and \(\gamma i\), where the parameters \(\beta,\gamma\ge0\). At a state where a transition is impossible, its rate is zero.

Definition: A fully observed event history on a fixed observation interval \([0,T]\) specifies the initial state, the ordered event times \(0<t_1<\cdots<t_m<T\), and the type of every event (infection or recovery). It also includes the fact that no further event occurred before \(T\). The likelihood below is a density for the event times, with respect to Lebesgue measure on their ordered region, together with the discrete probabilities of the event types.

Write \(Y_j\) for the state just after event \(j\), and set \(Y_0=X_0\). Between events the state is constant. If the state on an interval is \((s,i,r)\), the total event rate is \(\beta si/N+\gamma i\). The probability of no event for a duration \(u\) is the exponential of minus \(u\) times this total rate. If an event then occurs, its type-specific rate supplies the corresponding event-density factor.

Theorem (Likelihood of a complete SIR history): Suppose \(X_0\) is fixed and parameter-independent, the observation ends at a fixed time \(T\), and the stated event history is compatible with the SIR transitions. Let \(n_{\mathrm{inf}}\) and \(n_{\mathrm{rec}}\) be the numbers of infection and recovery events. Define \(A=\int_0^T S_tI_t/N\,dt\) and \(B=\int_0^T I_t\,dt\). Then, up to a factor independent of \(\beta,\gamma\), the likelihood is \(L(\beta,\gamma)=\beta^{n_{\mathrm{inf}}}\gamma^{n_{\mathrm{rec}}}\exp(-\beta A-\gamma B)\), where a zero event rate at an observed event makes the likelihood zero.

Proof. On any interval during which the state is fixed, the two possible event mechanisms have constant rates \(a=\beta si/N\) and \(b=\gamma i\). Their waiting times can be represented by independent exponential clocks with those rates. Thus the probability that neither clock rings during a duration \(u\) is \(e^{-au}e^{-bu}=e^{-(a+b)u}\). The density that the first event occurs after duration \(u\) and is an infection is \(a e^{-(a+b)u}\): the infection clock has density \(ae^{-au}\), while the recovery clock has survival probability \(e^{-bu}\). The recovery-event density is \(b e^{-(a+b)u}\), by the same calculation with the clocks interchanged. If one or both rates are zero, these formulas still apply; an event with rate zero has density zero.

Apply these factors successively to each observed waiting interval and event, and then include the probability of no event from \(t_m\) to \(T\). The rate factors at infection events contribute \(\beta si/N\) each, and those at recovery events contribute \(\gamma i\) each. Their parameter-dependent parts therefore multiply to \(\beta^{n_{\mathrm{inf}}}\gamma^{n_{\mathrm{rec}}}\); the state-dependent factors do not depend on the parameters. The no-event factors over all intervals multiply to the exponential of minus the integral of the total rate. Since the state is constant between events, that integrated rate is \(\int_0^T(\beta S_tI_t/N+\gamma I_t)\,dt=\beta A+\gamma B\). Multiplying the event and no-event factors gives the stated likelihood. If an observed event has zero rate, its event factor is zero, as asserted. \(\square\)

This derivation also explains the role of observation: an event contributes its instantaneous rate, while every interval contributes evidence against events that could have occurred. The integrals \(A\) and \(B\) are the total infection and recovery exposures. They summarize the time at risk in the fully observed history.

Maximum-Likelihood Estimates

Theorem (Separate rate estimates): For the likelihood above, if \(A>0\) and \(B>0\), and the parameter space allows \(\beta,\gamma\ge0\), the maximum-likelihood estimates are \(\widehat{\beta}=n_{\mathrm{inf}}/A\) and \(\widehat{\gamma}=n_{\mathrm{rec}}/B\). A zero event count gives a boundary estimate of zero. If parameters are required to be strictly positive, a zero count gives a supremum as the corresponding parameter decreases to zero, rather than an attained maximum.

Proof. With \(A,B>0\), the log likelihood for positive parameters is \(\ell(\beta,\gamma)=n_{\mathrm{inf}}\log\beta+n_{\mathrm{rec}}\log\gamma-\beta A-\gamma B\), up to a constant. It is a sum of a function of \(\beta\) and a function of \(\gamma\), so each can be maximized separately. For a parameter \(\theta\) with event count \(n\) and exposure \(C>0\), the relevant function is \(g(\theta)=n\log\theta-C\theta\). If \(n>0\), its derivative is \(n/\theta-C\), which is positive for \(\theta<n/C\), zero at \(n/C\), and negative for \(\theta>n/C\). Thus its unique maximum is \(n/C\). If \(n=0\), the likelihood factor is \(e^{-C\theta}\), which decreases as \(\theta\) increases and is maximized over \(\theta\ge0\) at zero. Over strictly positive \(\theta\), it approaches its supremum as \(\theta\) decreases to zero but does not attain it. Applying these conclusions to \((n,C)=(n_{\mathrm{inf}},A)\) and \((n_{\mathrm{rec}},B)\) proves the result. \(\square\)

The positive-exposure conditions matter. If an exposure is zero and its event count is also zero, that parameter does not appear in the likelihood and cannot be estimated from that history. If exposure is zero but the corresponding event count is positive, the displayed likelihood formula has no finite maximizer. For an ordinary compatible SIR history with finite rates, an event of a given type requires positive exposure of that type before the event; this degenerate case signals an inconsistent history or an unsuitable likelihood specification.

Worked Example: A Complete History with Both Event Types

Take \(N=5\), initial state \((4,1,0)\), and fixed endpoint \(T=2\). Observe an infection at \(t_1=1/2\), a recovery at \(t_2=5/4\), and an infection at \(t_3=3/2\), with no further event before \(T\). Compute the likelihood and the maximum-likelihood estimates.

The successive states are \((4,1,0)\), \((3,2,0)\), \((3,1,1)\), and \((2,2,1)\). The infection exposure is accumulated interval by interval: \(\tfrac12\cdot\tfrac45=\tfrac25\) on \([0,\tfrac12)\); \(\tfrac34\cdot\tfrac65=\tfrac9{10}\) on \([\tfrac12,\tfrac54)\); \(\tfrac14\cdot\tfrac35=\tfrac3{20}\) on \([\tfrac54,\tfrac32)\); and \(\tfrac12\cdot\tfrac45=\tfrac25\) on \([\tfrac32,2]\). Therefore \(A=\tfrac25+\tfrac9{10}+\tfrac3{20}+\tfrac25=\tfrac{37}{20}\).

For recovery exposure, the four intervals contribute \(\tfrac12\cdot1=\tfrac12\), \(\tfrac34\cdot2=\tfrac32\), \(\tfrac14\cdot1=\tfrac14\), and \(\tfrac12\cdot2=1\). Hence \(B=\tfrac12+\tfrac32+\tfrac14+1=\tfrac{13}{4}\). There are two infections and one recovery. The event-rate factors, excluding their powers of the parameters, are \(\tfrac45\) at the first infection, \(2\) at the recovery, and \(\tfrac35\) at the second infection. Their product is \(\tfrac45\cdot2\cdot\tfrac35=\tfrac{24}{25}\).

Thus the full parameter-dependent likelihood, retaining the state-dependent event factors, is \(L(\beta,\gamma)=\tfrac{24}{25}\beta^2\gamma\exp(-\tfrac{37}{20}\beta-\tfrac{13}{4}\gamma)\). The estimates are \(\widehat{\beta}=2/(\tfrac{37}{20})=\tfrac{40}{37}\) and \(\widehat{\gamma}=1/(\tfrac{13}{4})=\tfrac4{13}\). Substitution into the score equations gives \(2/\widehat{\beta}-37/20=2/(40/37)-37/20=37/20-37/20=0\), and \(1/\widehat{\gamma}-13/4=1/(4/13)-13/4=13/4-13/4=0\).

Worked Example: No Observed Infection

Let \(N=4\), start from \((3,1,0)\), and observe through \(T=1\). The only event is a recovery at \(t=1/2\), after which the state is \((3,0,1)\); there are no further events. Find the likelihood and estimates.

Before the recovery, \(SI/N=3/4\) and \(I=1\) for a duration \(1/2\). After it, both exposures are zero. Thus \(A=(3/4)(1/2)=3/8\) and \(B=1(1/2)=1/2\). There are zero infections and one recovery. The recovery event-rate factor, without its parameter, is \(I=1\). Consequently \(L(\beta,\gamma)=\gamma\exp(-3\beta/8-\gamma/2)\). Over nonnegative parameters the maximum occurs at \(\widehat{\beta}=0\) and \(\widehat{\gamma}=1/(1/2)=2\).

At these values, the likelihood is \(2e^{-1}\), since \((3/8)\cdot0+(1/2)\cdot2=1\). For fixed \(\gamma\), increasing \(\beta\) multiplies the likelihood by \(e^{-3\beta/8}\), which is at most \(1\), confirming the boundary maximum at zero. If the model requires \(\beta>0\), there is no attained maximum for \(\beta\); the likelihood approaches its supremum as \(\beta\) decreases to zero.

Combining Independent Histories and Avoiding a Pitfall

For independent epidemics observed under the same parameter values, their likelihoods multiply. Equivalently, add their infection counts, recovery counts, infection exposures, and recovery exposures. The same rate estimates then use the pooled counts divided by the pooled exposures. This pooling is valid for fully observed histories under the stated model; it does not replace a model for partially observed events.

Worked Example: Pooling Two Epidemic Histories

Use the history in the first worked example, which has counts \((2,1)\) and exposures \((37/20,13/4)\). Add an independent epidemic with \(N=2\), initial state \((1,1,0)\), and endpoint \(T=1\). It has one infection at \(t=1/2\) and no further event.

For this second history, before the infection \(SI/N=1/2\) and \(I=1\) for \(1/2\) time unit. After infection, \(S=0\), \(I=2\), and the remaining time is \(1/2\). Its infection exposure is \(A_2=(1/2)(1/2)+0(1/2)=1/4\), and its recovery exposure is \(B_2=1(1/2)+2(1/2)=3/2\). Its event counts are one infection and zero recoveries. The absence of a recovery in the second half is included through the recovery exposure \(2(1/2)=1\).

The pooled counts are \(n_{\mathrm{inf}}=2+1=3\) and \(n_{\mathrm{rec}}=1+0=1\). The pooled exposures are \(A=37/20+1/4=37/20+5/20=21/10\) and \(B=13/4+3/2=13/4+6/4=19/4\). Therefore \(\widehat{\beta}=3/(21/10)=10/7\) and \(\widehat{\gamma}=1/(19/4)=4/19\). Substitution checks the pooled score equations: \(3/(10/7)-21/10=21/10-21/10=0\), and \(1/(4/19)-19/4=19/4-19/4=0\).

Common pitfall. Multiplying only the rates at observed events omits the evidence from waiting. In the first example, that incorrect calculation gives only \(\tfrac{24}{25}\beta^2\gamma\). It grows without bound as \(\beta\) increases, so it cannot yield the finite estimate supported by the data. The correct likelihood also includes \(\exp(-37\beta/20-13\gamma/4)\), which accounts for the probability of no extra event during the observed intervals and produces the finite estimates \(\tfrac{40}{37}\) and \(\tfrac4{13}\).

The likelihood also clarifies what the data can and cannot identify. Infection events inform \(\beta\) through their count, while time with susceptible and infectious individuals present informs it through \(A\). Recoveries inform \(\gamma\) through their count, while infectious person-time informs it through \(B\). A final epidemic size alone generally does not provide these event times and exposures, so it does not supply this complete-history likelihood.

Check Your Understanding

Use the event-rate and integrated-exposure factors to answer each question.

  1. For a fully observed SIR history, explain why an infection contributes a factor involving \(\beta S_tI_t/N\), while a recovery contributes one involving \(\gamma I_t\).
  2. If a history has three infections, one recovery, infection exposure \(A=2\), and recovery exposure \(B=1/2\), find both maximum-likelihood estimates.
  3. Why must the likelihood include a term for intervals with no observed events? Identify the corresponding terms in the SIR likelihood.
  4. If there are no observed infections but \(A>0\), describe the maximum over \(\beta\ge0\) and what changes if \(\beta\) is restricted to be positive.
  5. For independent fully observed epidemics with common parameters, which four quantities are added before computing the estimates?