Objective

To analyze the dynamics of the Susceptibles-Infectious-Recovered/Carrier (SIR/C) epidemic model as applied to hepatitis B.

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.

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]        # carrier
  
  with ( 
    as.list (parameters),     # variable names within parameters can be used 
         {
           # compute derivatives
           dS = (-beta * S * I) - (reduce_transmission_rate * beta *S * C)
           dI = (beta * S * I) + (reduce_transmission_rate * beta * S * C) - (gamma * I)
           dR = (1 - proportion_of_acute_infection) * (gamma * I) + (theta * C)
           dC = (proportion_of_acute_infection * gamma * I) - (theta * C)
           
           # combine results
           results = c (dS, dI, dR, dC)
           list (results)
         }
    )
}

Parameters

contact_rate = 15                     # number of contacts per day
transmission_probability = 0.07       # transmission probability
infectious_period = 10                 # infectious period
reduce_transmission_rate = 0.5        # reduce transmission rate
proportion_of_acute_infection = 0.3   # proportion of acute infection that become carriers

Compute values of beta (transmission rate) and gamma (recovery rate).

beta_value = contact_rate * transmission_probability
gamma_value = 1 / infectious_period
theta_value = 0.7

Compute Ro - Reproductive number.

Ro = beta_value / gamma_value

Disease dynamics parameters.

parameter_list = c (beta = beta_value, gamma = gamma_value, theta = theta_value, reduce_transmission_rate = 0.5, proportion_of_acute_infection = 0.3)

Initial values for sub-populations.

X = 741        # susceptible hosts
Y = 98           # infectious hosts
C = 69           # carrier hosts
Z = 92           # recovered hosts

Compute total population.

N = X + Y + Z + C

Initial state values for the differential equations.

initial_values = c (S = X/N, I = Y/N, C = C/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 of Infectious sub-population.

plot (I ~ time, data = output, type='b', col = 'red')  

Plot dynamics of Recovered sub-population.

plot (R ~ time, data = output, type='b', col = 'green') 

Plot dynamics of Carrier sub-population.

plot (C ~ time, data = output, type='b', col = 'purple')  

Plot dynamics of Susceptibles, Infectious, Carrier, 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 = 'SIRC 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)  

# recovered hosts over time
plot (R ~ time, data = output, type='b', ylim = c(0,1), col = 'green', 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)  

Description and Results

The SIR/C model covers four infectious disease stages: Susceptible (S), Infectious (I), Recovery (R), and Carrier (C). The host begins in the suspectible stage before becoming infectious. From the infectious stage, the host then reaches the recovery stage and is no longer susceptible to the disease because of developing immunity. Or the host becomes a carrier and continues to carry the disease with them. As shown above, hepatitis B is a good example of this model since humans are susceptible, become infectious for a short period of time, and either recover or become a carrier.