Objective

To analyze the dynamics of the Susceptibles-Infectious (SI) epidemic model as applied to HIV.

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.

si_model = function (current_timepoint, state_values, parameters)
{
  # create state variables (local variables)
  S = state_values [1]        # susceptibles
  I = state_values [2]        # infectious
  
  with ( 
    as.list (parameters),     # variable names within parameters can be used 
         {
           # compute derivatives
           dS = (-beta * S * I)
           dI = ( beta * S * I) - (gamma * I)
           
           # combine results
           results = c (dS, dI)
           list (results)
         }
    )
}

Parameters

contact_rate = 1                     # number of contacts per day
transmission_probability = 0.04       # transmission probability
infectious_period = 800                 # infectious period

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

beta_value = contact_rate * transmission_probability
gamma_value = 1 / infectious_period

Compute Ro - Reproductive number.

Ro = beta_value / gamma_value

Disease dynamics parameters.

parameter_list = c (beta = beta_value, gamma = gamma_value)

Initial values for sub-populations.

X = 568        # susceptible hosts
Y = 432          # infectious hosts

Compute total population.

N = X + Y

Initial state values for the differential equations.

initial_values = c (S = X/N, I = Y/N)

Output timepoints.

timepoints = seq (0, 50, by=1)

Simulate the SI epidemic.

output = lsoda (initial_values, timepoints, si_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 Susceptibles and Infectious 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', main = 'SI 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)  

Description and Results

The SI model covers two infectious disease stages: Susceptible (S) and Infectious (I). The host begins in the suspectible stage before becoming infectious. The host remains in the infectious stage and never leaves it. As shown above, HIV is a good example of this model since humans are susceptible, become infectious, and then remain so for the rest of their lives, never reaching the recovered stage.