Objective
To analyze the dynamics of the Susceptibles-Exposed -Infectious-Susceptible (SEIS) epidemic model as applied to tuberculosis.
Remove all objects from workspace.
remove (list = objects() )
Load add-on packages - deSolve - contains lsoda function - differential equation solver.
library (deSolve)
##
## Attaching package: 'deSolve'
##
## The following object is masked from 'package:graphics':
##
## matplot
Function to compute derivatives of the differential equations.
seis_model = function (current_timepoint, state_values, parameters)
{
# create state variables (local variables)
S = state_values [1] # susceptibles
E = state_values [2] # exposed
I = state_values [3] # infectious
S = state_values [4] # susceptibles
with (
as.list (parameters), # variable names within parameters can be used
{
# compute derivatives
dS = (-beta * S * I)
dE = ( beta * S * I) - (delta * E)
dI = ( beta * S * I) - (gamma * I)
dS = (-beta * S * I)
# combine results
results = c (dS, dE, dI, dS)
list (results)
}
)
}
Parameters
contact_rate = 27 # number of contacts per day
transmission_probability = 0.18 # transmission probability
infectious_period = 30 # infectious period
latent_period = 28 # latent period
Compute values of beta (tranmission rate) and gamma (recovery rate).
beta_value = contact_rate * transmission_probability
gamma_value = 1 / infectious_period
delta_value = 1 / latent_period
Compute Ro - Reproductive number.
Ro = beta_value / gamma_value
Disease dynamics parameters.
parameter_list = c (beta = beta_value, gamma = gamma_value, delta = delta_value)
Initial values for sub-populations.
X = 445 # susceptible hosts
E = 210 # exposed hosts
Y = 151 # infectious hosts
Z = 194 # susceptible hosts
Compute total population.
N = X + Y + Z + E
Initial state values for the differential equations.
initial_values = c (S = X/N, E = E/N, I = Y/N, R = Z/N)
Output timepoints.
timepoints = seq (0, 50, by=1)
Simulate the SEIS epidemic.
output = lsoda (initial_values, timepoints, seis_model, parameter_list)
Plot dynamics of Susceptibles sub-population.
plot (S ~ time, data = output, type='b', col = 'blue')
Plot dynamics of Exposed sub-population.
plot (E ~ time, data = output, type='b', col = 'purple')
Plot dynamics of Infectious sub-population.
plot (I ~ time, data = output, type='b', col = 'red')
Plot dynamics of Susceptible sub-population.
plot (R ~ time, data = output, type='b', col = 'green')
Plot dynamics of Susceptibles, Exposed, Infectious, and Susceptible sub-populations in the same plot.
# susceptible hosts over time
plot (S ~ time, data = output, type='b', ylim = c(0,1), col = 'blue', ylab = 'S, E, I, S', main = 'SEIS epidemic')
# remain on same frame
par (new = TRUE)
# exposed hosts over time
plot (E ~ time, data = output, type='b', ylim = c(0,1), col = 'purple', ylab = '', axes = FALSE)
# remain on same frame
par (new = TRUE)
# infectious hosts over time
plot (I ~ time, data = output, type='b', ylim = c(0,1), col = 'red', ylab = '', axes = FALSE)
# remain on same frame
par (new = TRUE)
# susceptible hosts over time
plot (R ~ time, data = output, type='b', ylim = c(0,1), col = 'green', ylab = '', axes = FALSE)
Description and Results
The SEIS model covers four infectious disease stages: Susceptible (S), Exposed (E), Infectious (I), and Susceptible (S). The host begins in the suspectible stage before being exposed to the disease and then becoming infectious. From the infectious stage, the host then reaches the susceptible stage again because they do not develop immunity. As shown above, tuberculosis is a good example of this model since humans are susceptible, can be exposed to the disease from other infected humans, and become highly infectious for a period of time before reaching the susceptible stage again.