Objective: To analyze the dynamics of the Susceptible-Infectious-Recovered-Carrier (SIR/C) epidemic model
remove (list = objects() )
library (deSolve)
##
## Attaching package: 'deSolve'
##
## The following object is masked from 'package:graphics':
##
## matplot
Function to compute derivatives of the differential equations.
sirc_model = function (current_timepoint, state_values, parameters)
{
# create state variables (local variables)
S = state_values [1] # susceptibles
I = state_values [2] # infectious
R = state_values [3] # recovered
C = state_values [4] # carriers
with (
as.list (parameters), # variable names within parameters can be used
{
# compute derivatives
dS = (-beta * S * I) - (epsilon * beta * S * C)
dI = (beta * S * I) + (epsilon * beta * S * C) - (gamma * I)
dR = (1 - rho) * (gamma * I) + (tau * C)
dC = (rho * gamma * I) - (tau * C)
# combine results
results = c (dS, dI, dR, dC)
list (results)
}
)
}
Parameters
contact_rate = 6 # number of contacts per day
transmission_probability = 0.07 # transmission probability
infectious_period = 12 # infectious period
reduced_transmission_rate = 0.09 # chronic carriers compared to acute infections
acute_infections_proportion = 0.67 # acute infections that become carriers
length_of_time_in_carrier_state = 5 # length of time in carrier state
Compute values of beta (transmission rate), epsilon (reduced transmission rate), tau (carrier state), q (acute infections), and gamma (recovery rate)
beta_value = contact_rate * transmission_probability
gamma_value = 1 / infectious_period
epsilon_value = 0.09
tau_value = 1 / length_of_time_in_carrier_state
rho_value = 0.67
Compute Ro - Reproductive number
Ro = beta_value / gamma_value
Disease dynamics paramters
parameter_list = c (beta = beta_value, gamma = gamma_value, epsilon = epsilon_value, tau = tau_value, rho = rho_value)
Initial values for sub-populations
V = 4 # carrier hosts
X = 17280 # susceptible hosts
Y = 21 # infectious hosts
Z = 770 # recovered hosts
Compute total population
N = V + X + Y + Z
Initial state values for the differential equations
initial_values = c (S = X/N, I = Y/N, C = V/N, R = Z/N)
OUtput timepoints
timepoints = seq (0, 50, by=1)
Simulate the SIR/C epidemic
output = lsoda (initial_values, timepoints, sirc_model, parameter_list)
Plot dynamics of Susceptibles sub-population
plot (S ~ time, data = output, type='b', col = 'blue')
Plot dynamics for Infectious sub-population
plot (I ~ time, data = output, type='b', col = 'red')
Plot dynamics for Carriers sub-population
plot (C ~ time, data = output, type='b', col = 'purple')
Plot dynamics for Recovered sub-population
plot (R ~ time, data = output, type='b', col = 'green')
Plot dynamics of Susceptibles, Infectious, Carriers and Recovered 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, I, R, C', main = 'SIR/C epidemic')
# 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)
# carrier hosts over time
plot (C ~ time, data = output, type='b', ylim = c(0,1), col = 'purple', ylab = '', axes = FALSE)
# remain on same frame
par (new = TRUE)
# recovered hosts over time
plot (R ~ time, data = output, type='b', ylim = c(0,1), col = 'green', ylab = '', axes = FALSE)
Conclusions/Discussion: The purpose of epidemic modeling is to predict ‘what if’ scenarios. Because not all diseases have the same transmission dynamics, they must be represented through epidemic modeling differently. For chickenpox and swine fever, the SIR model is used to represent the transmission dynamics because a person will infect another person directly. Once a person recovers, they have gained immunity to the disease. Influenza and rabies is represented through the SEIR model. The SEIR model differs from the SIR model with the addition of a latency period. Persons that are exposed (E) have had contact with an infectious person, but are not infectious themselves. For an SIS model (rotaviruses), infected persons return to being susceptible after recovery because the disease does not give immunity against reinfection. The SEIS model is similar to the SEIR model in that there is an exposed or latency period. However, instead of recovering, a person returns to being susceptible (this is true for the case of TB). HIV is represented by the SI model. Once a person becomes infected, they remain infectious to other people. Lastly, the SIR/C model represents a person that once infected with a disease, can either recover from it or become a life-long carrier.