Skip to content

SEIRS Model Description

Ryan Seamus McGee edited this page Aug 12, 2020 · 6 revisions

Contents:

Compartment Model

Disease States

The foundation of the models in this package is the classic SEIR model of infectious disease. The SEIR model is a standard compartmental model in which the population is divided into susceptible (S), exposed (E), infectious (I), and recovered (R) individuals. A susceptible member of the population becomes infected (exposed) when making a transmissive contact with an infectious individual and then progresses to the infectious and finally recovered states. In the SEIRS model, recovered individuals may become resusceptible some time after recovering (although re-susceptibility can be excluded if not applicable or desired).

The rates of transition between the states are given by the parameters:

  • σ: rate of progression (inverse of incubation period)
  • γ: rate of recovery (inverse of infectious period)
  • ξ: rate of re-susceptibility (inverse of temporary immunity period; 0 if permanent immunity)
  • μI: rate of mortality from the disease (deaths per infectious individual per time)

Vital dynamics are also supported in these models (optional, off by default), but aren't discussed in the README.

See the Transmission section for more information about the dynamics of transmission and associated parameters in the respective model implementations.

Quarantine States

The effect of isolation-based interventions (e.g., isolating individuals in response to testing or contact tracing) are modeled by introducing compartments representing quarantined individuals. An individual may be quarantined in any disease state, and every disease state has a corresponding quarantine compartment. Quarantined individuals follow the same progression through the disease states, but the rates of transition or other parameters may be different. There are multiple methods by which individuals can be moved into or out of quarantine states. See the Interventions sections for more information about isolation and other interventions.

In addition to the parameters given above, transitions between quarantine states are governed by the parameters: In addition to the parameters given above, transitions between quarantine states are governed by the parameters:

  • σQ: rate of progression to infectiousness for quarantined individuals (inverse of latent period)
  • γQ: rate of recovery for quarantined individuals (inverse of infectious period)

Deterministic Mean-field Model Implementation

The dynamics of the SEIRS model can be described by the following system of differential equations. This is a deterministic mean-field implementation of the model along the lines of standard compartment models in epidemiology. Note that this implementation implicitly assumes that that the population is homogeneous (i.e., all individuals have the same rates and parameters) and uniformly mixed (i.e., all individuals are equally likely to interact with all other individuals).

where S, E, I, Q_E, Q_I, R, and F are the numbers of susceptible, exposed, infectious, quarantined exposed, quarantined infectious, recovered, and deceased individuals, respectively, and where N is the total number of individuals in the populations.

Transmission

Transmission of the disease may occur when a susceptible individual comes into contact with an infected individual. The probability that a transmission event actually occurs during such a contact is proportional to the transmissibility β of the infected individual. In a large well-mixed population, the fraction of an individual's contacts that are infectious will be equal to the fraction of infectious individuals in the population. Then, the expected rate of new exposures in the population is given by the product of transmissibility and the prevalence of infectiousness.

The transmissibility parameter β can be related to the basic reproduction number R0 (i.e., the expected number of new infections generated by a single infectious individual in a completely susceptible population) by the standard formula:

Interventions (Testing & Isolation)

The effect of testing and isolation on the dynamics can be modeled by introducing the quarantine compartments and associated state transitions (highlighted arrows in diagram). Exposed and infectious individuals are tested at rates θE, θI, respectively, and test positively for infection with probabilities (i.e., sensitivities) ψE and ψI, respectively (the false positive rate is assumed to be zero). A positive test result moves an individual into the appropriate quarantine state, where rates of transmission, progression, recovery, or other properties may be different than those of undetected cases. Individuals remain in quarantine until they reach the recovered state.

Note that this implementation assumes that individuals are tested randomly at exponentially distributed intervals corresponding to the mean testing rates given by θE and θI. More sophisticated testing and isolation protocols can be modeled using the stochastic network model.

Stochastic Network Model Implementation

Standard compartment models capture important features of infectious disease dynamics, but they are deterministic mean-field models that assume uniform mixing of the population (i.e., every individual in the population is equally likely to interact with every other individual). However, it is often important to consider stochasticity, heterogeneity, and the structure of contact networks when studying disease transmission, and many strategies for mitigating spread can be thought of as perturbing the contact network (e.g., social distancing) or making use of it (e.g., contact tracing).

This package includes implementation of the SEIRS model on stochastic dynamical networks. Individuals are represented as nodes in a network, and parameters, contacts, and interventions can be specified on a targeted individual basis. The network model enables rigorous analysis of transmission patterns and network-based interventions with respect to the properties of realistic contact networks.

Contact Networks

Consider a graph G representing individuals (nodes) and their interactions (edges). Each individual (node) has a state (S, E, I R, F, etc). The set of nodes adjacent (connected by an edge) to an individual i defines their set of "close contacts" CG(i) (highlighted in black). At a given time, each individual makes contact with a random individual from their set of close contacts with probability (1-p) or with a random individual from anywhere in the network (highlighted in teal) with probability p. The latter "global" contacts represent individuals interacting with the population at large (i.e., individuals outside of ones' social circle), such as on public transit, at an event, etc. The parameter p defines the locality of the network: for p=0 an individual only interacts with their close contacts, while p=1 represents a uniformly mixed population. Social distancing interventions may increase the locality of the network (i.e., decrease p) and/or decrease local connectivity of the network (i.e., decrease the degree of individuals).

When a susceptible individual makes contact with an infectious individual they may become exposed. The probability of transmission depends in general on the transmissibility of the infectious individual and the susceptibility of the susceptible individual (the product of these parameters can be thought to weight the interaction edges). See Network Model: Transmission for more information.

Quarantine Contacts

Another graph GQ represents the interactions that each individual has while in a quarantine state. Quarantine has the effect of dropping some fraction of the edges connecting the quarantined individual to others (according to a rule of the user's choice when generating the graph GQ). The edges of GQ (highlighted in purple) are then a subset of the normal edges of G for that individual. The set of nodes that are adjacent to a quarantined individual i define their set of "quarantine contacts" CQ(i) (highlighted in purple). At a given time, a quarantined individual comes into contact with an individual in their set of quarantine contacts with probability (1-p) or comes into contact with a random individual from anywhere in the network with probability p. The parameter q (down)weights the intensity of interactions with the population at large while in quarantine relative to baseline. The transmissibility, susceptibility, and other parameters may be different for individuals in quarantine.

Specifying Contact Networks

The SEIRS dynamics can be simulated on any network. Networks must be generated and provided by the user; see SEIRSNetworkModel: Specifying Networks for more information about how to specify contact networks to the model. Network definition and generation is largely left to the user, but some convenience tools for generating example networks are included in this package. See Network Generation for more information.

Dynamics

Stochastic network dynamics are simulated using the Gillespie algorithm. Briefly, the system's differential equations are adapted to compute the 'propensity' of the possible state transitions (i.e., the expected amount of time until a given transition will take place) for all nodes at each time step. These propensities are then used to compute the probabilities of all possible state transitions normalized across the entire population. A random node and corresponding transition are selected according to these probabilities in each time step. The Gillespie algorithm is a common and rigorous method for simulating stochastic interaction dynamics.

For full documentation of the propensity calculations refer to the Model Equations.

Heterogeneity

Unlike mean-field compartment models, which do not model individual members of the population, the network model explicitly represents individuals as discrete nodes. All model parameters are assigned to each node on an individual basis. Therefore, the network model supports arbitrary parameter heterogeneity at the user's discretion (see SEIRSNetworkModel: Specifying Parameters for more information about assigning parameter values). In addition, the specification of the contact network allows for heterogeneity in interaction patterns to be explicitly modeled as well.

Transmission

Transmission of the disease may occur when a susceptible individual comes into contact with an infected individual. In the stochastic network model, an individual comes into contact with a random individual from the population at large (e.g., in a public space) with probability p or with an individual from their set of close contacts with probability (1-p). The propensity for a transmission event to actually occur during such a contact is proportional to the product of the susceptibility of the susceptible individual and the transmissibility β of the infected individual. Transmission that occurs between an individual and the population at large is referred to as global transmission, and transmission between an individual and one of their close contacts (network neighbors) is referred to as local transmission. In addition, an individual may come into contact with someone from outside the population of interest, possibly leading to an exogenous introduction of the disease.

The transmissibility parameter β can be related to the basic reproduction number R0 (i.e., the expected number of new infections generated by a single infectious individual in a completely susceptible population) by the standard formula:

The transmissibility of infectious individuals in quarantine states is given by the parameter parameter βQ. As with all parameters in the network model, transmissibility parameters are assigned to each node on an individual basis, and the population may be homogeneous or heterogeneous with respect to any of the transmissibility parameters at the user's discretion (see Specifying Transmissibility Parameters for more information).

In the following subsections, we will explain how global, local, and exogenous transmission are handled in this model, and we will break down the corresponding terms in the following equation, which gives the propensity (expected time) for the ith node to become infected (for the full set of stochastic network model equations, see Model Equations):

Global Transmission

A fraction p of a given individual's interactions are with individuals randomly sampled from the population at large, irrespective of the contact network. These global contacts represent one-off encounters with rare acquaintances or unknown members of the public (e.g., at the grocery store, on public transit, at an event). With respect to these global interactions, every node in the population is equally likely to come into contact with every other node, and the population can be considered well-mixed. Thus the propensity of global transmission is calculated in the same way as mean-field compartment models that assume a well-mixed population. The propensity for a given susceptible individual to become exposed due to global transmission is proportional to the product of that individual's susceptibility, the mean transmissibility of individuals in infectious states (mean-field), and the prevalence of infectious individuals in the overall population (frequency dependent).

The contribution of infectious individuals in quarantine to a given individual's propensity for exposure involves the transmissibility of quarantined individuals and their prevalence QI/N.

Local Transmission

A fraction 1-p of a given individual's interactions are with individuals from their set of "close contacts," which are defined as the nodes adjacent to the given node in the contact network (i.e., local). These close contacts represent individuals with whom one regularly interacts, such as housemates, coworkers, friends, etc.

With respect to local transmission, transmissibility is considered on a pairwise basis. That is, every directed edge of the contact network representing transmission from infected node j to susceptible node i is assigned a transmissibility weight βji. By default, the transmissibility of such an interaction is assumed to be equal to the transmissibility of the infected individual (i.e., βji = βj), but other methods of specifying pairwise transmissibility are possible, including specification of a transmissibility matrix (see Specifying Transmissibility Parameters for more information).

The propensity for a given susceptible individual to become exposed due to local transmission is calculated as the product of that individual's susceptibility and the sum transmissibility of their infectious close contacts, divided by the size of their local network. This amounts to the propensity of exposure for node i being proportional to the product of their susceptibility and the transmissibility weighted prevalence of infectious individuals in their local network. Thus, propensity for exposure due to local transmission is frequency dependent and analogous to the propensity contribution from global transmission. This frequency dependence means that an individual that has 1 infectious contact in 10 close contacts is twice as likely to become exposed as an individual that has 1 infectious contact in 20 close contacts. Implicit in this formulation is an assumption that all individuals have an equal interaction budget (e.g., equal amount of time spent interacting with others), and individuals with more close contacts (i.e., higher degree) interact less with each contact and are therefore less likely to become exposed by any given individual.

As with global transmission, the contributions of quarantined infectious contacts to the propensity for exposure are handled separately using a distinct set of pairwise transmissibility parameters βQji.

Connectivity Correction Factor

An additional factor 𝛿ji appears in the calculation of propensity for exposure due to local transmission. This pairwise factor can be used to weight the transmissibility of interactions according to the connectivity of the interacting individuals. For example, one might be interested in upweighting the likelihood transmission between highly connected nodes (as if individuals who have more contacts also have more intense interactions) in order to counteract, in part, the aforementioned implicit frequency-dependent assumption that all individuals have an equal interaction budget. Alternatively, pairwise interactions could be weighted as a function of other connectivity properties (or indeed any other arbitrary criteria) using this pairwise factor.

The SEIRSNetworkModel class implements a few options for weighting the propensity of local transmission as a function of the degree of the interacting nodes (optional, no correction term is used by default). One option upweights the likelihood transmission between highly connected nodes, with 𝛿ji defined as

where Dj and Di are the degrees of nodes j and i, respectively, and is the mean degree of the network. Using this definition of 𝛿ji, when two individuals whose average degree is an order of magnitude greater than the average degree of the population overall, then the propensity of exposure in their interaction is weighted to be twice that of two averagely-connected individuals. This is just one way to define 𝛿ji (implemented as a convenience option), but users can provide their own values for this term or choose not to use it as they wish.

Interventions

This framework offers multiple options for implementing simulations of important public health interventions, including testing, contact tracing, isolation, and social distancing.

A sophisticated and flexible Testing, Tracing, and Isolation (TTI) Simulation Loop is also provided and documented. This simulation loop can be parameterized to simulate a wide range of relevant scenarios, including community and workplace TTI mitigation, and is a useful starting point for implementing other scenarios of your own.

Testing

Rate-based Testing

Testing can be modeled using the quarantine compartments and associated state transitions (highlighted arrows in diagram). Exposed and infectious are tested at rates θE and θI, and test positively for infection with probabilities (i.e., sensitivities) ψE and ψI, respectively (See Model Equations for more details)(the false positive rate is assumed to be zero). A positive test result moves an individual into the appropriate quarantine state, where rates of transmission, progression, recovery, network connectivity, or other properties may be different. Individuals remain in isolation until their designated isolation time has been reached or until they recover.

Note that this implementation assumes that individuals are tested randomly at exponentially distributed intervals corresponding to mean testing rates given by θE and θpre. More sophisticated testing and isolation protocols can be modeled using the manual testing features, described below.

Manual Testing

Alternatively, testing can be implemented by interfacing with the model code during a simulation. The compartment states and other properties of individuals can be checked and modified by accessing the model object's attributes at any time. For example, an individual can be tested by accessing their state and running it through some testing logic (e.g., to model test sensitivity), and the state or parameters of individuals that are deemed positive can then be modified (e.g., to move them into a quarantine state). A custom simulation loop can execute any arbitrary testing protocol by interfacing with the model object in these ways. The timing of tests, selection criteria, sensitivity logic, turn around time, and consequences of positive tests can all be handled as desired in a custom simulation loop. For an in-depth example of a simulation loop that implements these manual testing features, see the TTI Simulation Loop.

Contact Tracing

Rate-based Tracing

Consideration of contact networks allows us to define compartment state transitions corresponding to contact tracing, where the close contacts of positive individuals are more likely to be tested. This rate-based implementation of contact tracing uses the quarantine compartments and associated state transitions. Here, an individual is tested due to contact tracing at a rate equal to φ times the number of its close contacts who have tested positively (See Model Equations for more details). Traced individuals test positively themselves with probabilities (i.e., sensitivities) given by ψE or ψI, according to their disease state (the false positive rate is assumed to be zero). A positive test result moves an individual into the appropriate quarantine state, where rates of transmission, progression, recovery, network connectivity, or other properties may be different. Individuals remain in isolation until their designated isolation time has been reached.

Note that this implementation assumes that individuals are tested due to tracing at exponentially distributed intervals corresponding to the mean tracing rates given by φE and φpre. More sophisticated tracing protocols can be modeled using the manual tracing features, described below.

Manual Tracing

Alternatively, tracing can be implemented by interfacing with the model code during a simulation. The contact network can be referred to at any time by interfacing with the corresponding graph stored in the model object. The SEIRSNetworkModel class includes a get_neighbors() function that returns the list of close contacts for a given node, which can then be used in a user-defined simulation loop to direct manual testing or pre-emptive isolation for those traced contacts. Beyond this, the entire contact network graph is accessible in the model object and can be used for more complex network-based intervention protocols. For an in-depth example of a simulation loop that implements these manual tracing features, see the TTI Simulation Loop.

Isolation

Isolation of individuals is modeled by introducing the quarantine states. Individuals may enter a quarantine state when they test positively for the disease or due to other criteria, such as being a close contact of a positive individual, being of a certain age group, etc. Individuals that are in quarantine states interact with others according to the quarantine contact network, and various parameters may be defined differently for individuals in quarantine.

When rate-based methods for testing and/or contact tracing are used (i.e., when testing rates θ and/or tracing rates φ are nonzero), individuals are moved into the appropriate quarantine states automatically at rates corresponding to the designated testing/tracing rates and sensitivities.

The SEIRSNetworkModel class also includes a set_isolate() function that can be called to move a given node between normal and quarantined states manually in a user-defined simulation loop (the states of individuals can also be modified by updating the appropriate state variable in the model object directly). These manual isolation options allow for individuals to be moved into quarantine without having been tested, such as in pre-emptively isolating contacts (e.g., housemates, coworkers) of positive cases.

The amount of time that individuals spend in isolation is set by the isolation_time parameter of the SEIRSNetworkModel class. Individuals remain in quarantine as they progress through disease states until this total isolation time is reached, at which time they are moved into the appropriate un-quarantined disease compartment. Individuals can also be moved out of quarantine states manually using the set_isolate() function or by updating the appropriate state variable in the SEIRSNetworkModel model object directly.

Social Distancing

Social distancing and related interventions (e.g., lockdowns, stay-at-home orders, "cocooning" of particular demographics) can be implemented by specifying a contact network with a structure that reflects the distancing scenario. Dynamic distancing scenarios can be explored by changing the structure of the contact network during a simulation. Changing between contact networks at designated time points in easy to do using the checkpoint feature of the SEIRSNetworkModel class. The contact network can also be changed manually by updating the graph stored by a SEIRSNetworkModel model object directly in a user-defined simulation script.

Model Equations

Parameters & Terms:

  • ⍺: susceptibility
  • β: transmissibility
  • βQ: transmissibility of quarantined individuals
  • σ: rate of progression to infectiousness (inverse of latent period)
  • γ: rate of recovery (inverse of infectious period)
  • f: probability of death for hospitalized individuals (case fatality rate)
  • μI: rate of death for hospitalized individuals (inverse of admission-to-death period)
  • σQ: rate of progression to infectiousness for quarantined individuals (inverse of latent period)
  • γQ: rate of recovery for quarantined individuals (inverse of infectious period)
  • ξ: rate of re-susceptibility (inverse of temporary immunity period; 0 if permanent immunity) period)
  • p: probability of global interaction (conditional on interaction within the population of interest)
  • q: weight of intensity of global interactions for individuals in quarantine
  • CG(i): close contacts of an individual i (adjacent nodes in contact network)
  • CQ(i): close contacts of a quarantined individual i (adjacent nodes in quarantine contact network)
  • 1Xi = Z: indicator function, equal to 1 if the state of node i is Z, equal to 0 otherwise

Propensity Equations:

Each node i has a state Xi, and the propensities of state transitions (i.e., expected time to transition) for a given node are given by the following equations: