Rachel Oughton
15/02/2023
So far we have explored the relatively simple closed SIR model.
However, real world infectious diseases are often much more complex.
Today we will look at some examples of extending the SIR model to have more realistic features:
Let’s now investigate the impact of adding a pre-infectious (or exposed) \(E\) compartment, to create an SEIR model.
The trajectory in an SEIR model.
Need to rethink the differential equation slightly:
When people leave the \(S\) compartment,
So the equation for \(S\) remains the same:
\[\frac{dS}{dt} = -\frac{\beta I S}{N}.\]
The people leaving \(S\) above are joining \(E\), but still being infected by those in \(I\)
As people’s latent period comes to an end, they move to the \(I\) compartment.
Therefore we have:
\[\frac{dE}{dt} = \frac{\beta I S}{N} - \sigma E.\]
People are now joining the \(I\) compartment from \(E\) with rate \(\sigma\),
Therefore:
\[\frac{dI}{dt} = \sigma E - \gamma I. \]
Rate of change in recovered/removed (\(R\)) is unchanged
Our system of equations for an SEIR model is therefore:
\[\begin{align*} \frac{dS}{dt} &= \color{green}{b N}- \color{purple}{m S} -\frac{\beta I S}{N}\\ \frac{dE}{dt} &= \frac{\beta I S}{N} - \sigma E - \color{purple}{m E} \\ \frac{dI}{dt} &= \sigma E - \gamma I - \color{purple}{m I}\\ \frac{dR}{dt} &= \gamma I - \color{purple}{m R} \end{align*}\].
In this section:
One simple change is to include vital dynamics - birth and death rates.
This is especially important over long time periods (years)
Our SEIR equations now become
\[\begin{align*} \frac{dS}{dt} &= \color{green}{b N}- \color{purple}{m S} -\frac{\beta I S}{N}\\ \frac{dE}{dt} &= \frac{\beta I S}{N} - \sigma E - \color{purple}{m E} \\ \frac{dI}{dt} &= \sigma E - \gamma I - \color{purple}{m I}\\ \frac{dR}{dt} &= \gamma I - \color{purple}{m R} \end{align*}\]
Where \(b\) and \(m\) are the birth and mortality rates, and \(0<{b,m}<1\)
Note that \(m\) represents the general underlying mortality rate, not mortality specifically related to this epidemic.
It is common practice to assume a stable population by setting \(m=b\)
Note: In an open epidemic it is more common to work with proportions of people in compartments, rather than total numbers.
Let’s start with parameter values \[ \begin{align*} \beta &= \frac{2}{7} \\ \sigma & = \frac{1}{2} \\ \gamma & = \frac{1}{14} \end{align*} \] and initial values (now thinking in proportions) \[ \begin{align*} S & = 0.999\\ E & = 0 \\ I& = 0.001\\ R & = 0 \end{align*} \]
library(deSolve)
sir_vital = function (t, y, params)
{
# label state variables from within the y vector
S = y[1] # susceptibles
E = y[2] # Exposed
I = y[3] # infectious
R = y[4] # recovered
N = S + E + I + R
# Pull parameter values from the params vector
beta = params["beta"]
gamma = params["gamma"]
sigma = params["sigma"]
m = params["m"]
b=params["b"]
# Define equations, now with m and b terms
dS = b*N -m*S-(beta*S*I)/N
dE = beta*S*I/N - sigma*E - m*E
dI = sigma*E - gamma*I -m*I
dR = gamma * I - m*R
# return list of gradients
res = c(dS, dE, dI, dR)
list(res)
}
The first nine months of this model without population dynamics (ie. with \(b=m=0\)).
The same system with \(m=b = \frac{1}{7*365}\). This is for exaggeration purposes - it assumes an average life expectancy of 7 years.
The same SIR model plotted for five years. \(S\) gradually increases, a threshold is reached and there is another small peak (around day 1500).
Often used to model diseases such as Measles (pre-vaccine) where there can be a low level of the disease present in the population, with occasional outbreaks.
The \(I\) compartment for a measles-like disease plotted for 70 years.
Here, \(\beta = \frac{13}{7},\,\sigma=\frac{1}{8},\,\gamma = \frac{1}{7}\) and \(m = b = \frac{1}{365\times 70}\)
In this section:
So far we have focussed on infectious diseases that lead to full immunity following infection.
In the SIR model, once people are in the \(R\) (Removed) compartment, they stay there
forever.
In fact, with many infectious diseases:
This is an SEIRS model.
We use the parameter \(w\) to denote the rate at which immunity is lost, and our equations become
\[ \begin{align*} \frac{dS}{dt} &= \color{blue}{wR} -\frac{\beta I S}{N}\\ \frac{dE}{dt} &= \frac{\beta I S}{N} - \sigma E \\ \frac{dI}{dt} &= \sigma E - \gamma I \\ \frac{dR}{dt} &= \gamma I - \color{blue}{wR} \end{align*} \]
The average time for which someone retains their immunity will therefore be \(\frac{1}{w}\) (in terms of the model’s time units).
library(deSolve)
sir_wane = function (t, y, params)
{
# label state variables from within the y vector
S = y[1] # susceptibles
E = y[2] # Exposed
I = y[3] # infectious
R = y[4] # recovered
N = S + E + I + R
# Pull parameter values from the params vector, including new 'w' parameter
beta = params["beta"]
gamma = params["gamma"]
sigma = params["sigma"]
w = params["w"]
# Define equations, now with w terms
dS = w*R - (beta*S*I)/N
dE = beta*S*I/N - sigma*E
dI = sigma*E - gamma*I
dR = gamma * I - w*R
# return list of gradients
res = c(dS, dE, dI, dR)
list(res)
}
We will use the same parameter values as in our first open epidemic example:
\[ \begin{align*} \beta &= \frac{2}{7} \\ \sigma & = \frac{1}{2} \\ \gamma & = \frac{1}{14} \end{align*} \] and initial values (now in terms of proportions) \[ \begin{align*} S & = 0.999\\ E & = 0 \\ I& = 0.001\\ R & = 0 \end{align*} \]
If we set \(w=0\) then people don’t leave the \(R\) compartment and immunity doesn’t wane:
Now we set \(w=0.01\) (so that people retain immunity for an average of 100 days).
Plotting over 5 years, we see that an equilibrium is reached
Unlike the models we have seen so far, people cycle through the compartments.
In this section we will study a real example that includes:
From White et al. (2007).
Human respiratory syncytial virus (RSV):
The point of this example is to show you a real compartmental infectious disease model, and some of its features - don’t worry about retaining the detail!
In this model, there are four compartments:
The birth and mortality rates are assumed equal (\(\mu\)) so that \[ S + I_S + I_R + R = N.\]
There is a term for every transfer in the model:
\[\begin{align*} \frac{dS}{dt} & = \mu N-\frac{\Lambda\left(t\right) S}{N} + \frac{\alpha \tau}{\rho}\left(I_S + I_R + R\right) - \mu S\\ \frac{dI_S}{dt} & = \frac{\Lambda\left(t\right) S}{N} - \left(\tau + \mu\right) I_S \\ \frac{dI_R}{dt} & = \frac{\sigma\Lambda\left(t\right) R}{N} - \left(\frac{\tau}{\rho} + \mu\right)I_R\\ \frac{dR}{dt} & = \left(1-\frac{\alpha}{\rho}\right)\tau I_S + \left(1-\alpha\right)\frac{\tau}{\rho}I_R - R\left(\frac{\sigma\Lambda\left(t\right)}{N}+\frac{\alpha\tau}{\rho}+\mu\right). \end{align*}\]
Notice that infection involves a function \(\Lambda\left(t\right)\)
The function \(\Lambda\left(t\right)\) (which governs infectiousness) is given by
\[\begin{equation} \Lambda\left(t\right) = Q\left(t\right)\times{}\left(I_S + \eta I_R\right)\times{\left(\tau+\mu\right)}. \end{equation}\]
In White et al. (2007), \(Q\left(t\right)\) is used to represent seasonal variation (more on that later).
For now we set \(Q\left(t\right)=\frac{b}{\tau+\mu}\), so that
\[ \Lambda\left(t\right) = b\left(I_S + \eta I_R\right). \] Here,
To run this model, we need
We set initial proportions to:
\[\begin{align*} S & = 0.999\\ I_S& = 0.001\\ I_R& = 0,\\ R & = 0. \end{align*}\]
and parameter values to:
\[\begin{align*} \mu& = \frac{1}{365\times{70}}\\ \alpha& = 0.16\\ \tau& = \frac{1}{6} \end{align*}\]
\[\begin{align*} \rho & = 0.8\\ \sigma & = 0.3\\ b & = 0.5\\ \eta & = 0.8 \end{align*}\]
This system reaches an equilibrium by around day 60.
Note that people are still moving between compartments, but that the proportions in each remain steady.
Seasonal variability is an important component of many infectious disease models, and so we will now include it.
White et al. (2007) specify \[ Q\left(t\right) = \frac{b\left(a\cos\left[2\pi\left(t-\phi\right)\right]+1\right)}{\tau+\mu}. \]
Here
Remember that the seasonality function \(Q\left(t\right)\) is involved in the model via the transmission function \(\Lambda\left(t\right)\),
In groups, discuss what you expect to see as we include seasonality in the model. How do you think it will differ from the version with no seasonality?
After the initial outbreak, the system settles into a cycle.
For this plot, we set a=0.5, phi=0.
In this lecture we have looked at some developments to SIR-type models that enable them to model more complex behaviour.