SIR Compartmental Model

The SIR model is a compartmental model which is comprised of three main compartments: susceptible (S), infected (I), and recovered (R). Additionally, discovered (D) and hidden (H) compartments keep track of the number of infected or recovered that have been discovered. The population is divided into “groups” which interact with one another. Every generation in the simulation, some people move from susceptible to infected based on internal group interactions and an external outside rate of infection. The length of a generation is referred to as a generation time. A person infected in one generation will be recovered by the next. Furthermore, people move from hidden to discovered based on an infection discovery and recovered discovery fraction. The infection discovery fraction denotes the fraction of infected population that is discovered in the generation in which they are infected. The recovered discovery fraction denotes the fraction of the hidden recovered population that become discovered in every generation. This is non-standard and arises from a desire to model the “discovery” of infections as a result of testing.

Mathematically, let k be the number of groups and T be the number generations to simulate. Let S, I, R, D, and H be T by k matrices such that S[i,j] is the number of people in group j susceptible during generation i. State variables in SIR models are usually fractions of an overall population but these are counts. Let A be a k by k matrix encoding the interactions between groups such that A[i,j] is the number of infections in group j caused by a single infection in group i. Let o be the vector representing the outside rate of infection such that o[i] is the count of infections per generation time occurring in group i as a result of outside infection. Lastly, let a and r be the vectors representing the infection and recovered discovery fractions respectively.

Given a state at generation t, the following state at generation t+1 is given as follows.

S[t+1] =

S[t] - I[t+1]

I[t+1] =

\min((I[t]A + o) * (S[t] / (S[t] + I[t] + R[t])), S[t])

R[t+1] =

R[t] + I[t]

D[t+1] =

D[t] + a \cdot I[t+1] + r \cdot H[t]

H[t+1] =

(1-a) \cdot I[t+1] + (1-r) \cdot H[t]

The simpar.sim module implements this exact SIR model.