-
Notifications
You must be signed in to change notification settings - Fork 218
Extended SEIRS Model Description
This model extends the classic SEIR model of infectious disease to represent pre-symptomatic, asymptomatic, and severely symptomatic disease states, which are of particular relevance to the SARS-CoV-2 pandemic. The classic SEIR model divides the population into susceptible (S), exposed (E), infectious (I), and recovered (R) individuals. In this extended model, the infectious subpopulation is further subdivided into pre-symptomatic (Ipre), asymptomatic (Iasym), symptomatic (Isym), and hospitalized (severely symptomatic, IH) compartments. All of these I compartments represent contagious individuals, but transmissibility, rates of progression, and other properties may vary between these disease states.
A susceptible (S) member of the population becomes infected (exposed) when making a transmissive contact with an infectious individual. Newly exposed (E) individuals first experience a latent period during which time they are not contagious (e.g., while a virus is replicating, but before shedding). Infected individuals then progress to a pre-symptomatic infectious state (Ipre), in which they are contagious but not yet presenting symptoms. Some infectious individuals go on to develop symptoms (Isym), while a portion of the population never develops symptoms despite being contagious (Iasym). A subset of symptomatic individuals progress to a severe clinical state and must be hospitalized (IH), and some fraction severe cases are fatal (F). At the conclusion of the infectious period, infected individuals enter the recovered state (R) and are no longer contagious or susceptible to infection. As in a SEIRS model, recovered individuals may become resusceptible some time after recovering (although re-susceptibility can be excluded if not applicable or desired). (Vital dynamics are also supported in these models (optional, off by default), but aren't discussed in the wiki.)
The rates of transition between the states are governed by the parameters:
- σ: rate of progression to infectiousness (inverse of latent period)
- λ: rate of progression to (a)symptomatic state (inverse of pre-symptomatic period)
- a: probability of an infected individual remaining asymptomatic
- h: probability of a symptomatic individual being hospitalized
- η: rate of progression to hospitalized state (inverse of onset-to-admission period)
- γ: rate of recovery for non-hospitalized symptomatic individuals (inverse of symptomatic infectious period)
- γA: rate of recovery for asymptomatic individuals (inverse of asymptomatic infectious period)
- γH: rate of recovery hospitalized symptomatic individuals (inverse of hospitalized infectious period)
- f: probability of death for hospitalized individuals (case fatality rate)
- μH: rate of death for hospitalized individuals (inverse of admission-to-death period)
- ξ: rate of re-susceptibility (inverse of temporary immunity period; 0 if permanent immunity)
See the Transmission section for more information about the dynamics of transmission and associated parameters in the respective model implementations.
Note that the extended model reduces to the basic SEIRS model for a = 0, h = 0, and σ → 0.
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 (with the exception of the hospitalized state, which is considered a quarantine state for transmission and other purposes). 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:
- σQ: rate of progression to infectiousness for quarantined individuals (inverse of latent period)
- λQ: rate of progression to (a)symptomatic state for quarantined individuals (inverse of pre-symptomatic period)
- ηQ: rate of progression to hospitalized state for quarantined individuals (inverse of onset-to-admission period)
- γQS: rate of recovery for quarantined non-hospitalized symptomatic individuals (inverse of symptomatic infectious period)
- γQA: rate of recovery for non-hospitalized asymptomatic individuals (inverse of asymptomatic infectious period)
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 Extended 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.
Consider a graph G representing individuals (nodes) and their interactions (edges). Each individual (node) has a state (S, E, Ipre, Isym, Iasym, H, 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.
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.
The extended SEIRS dynamics can be simulated on any network. Networks must be generated and provided by the user; see ExtSEIRSNetworkModel
: 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.
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.
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 ExtSEIRSNetworkModel
: 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 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:
In the extended model, pre-symptomatic, asymptomatic, and symptomatic infectious states are represented separately. The transmissibility of pre- and asymptomatic individuals is given by the parameter βA, which may differ from the baseline symptomatic transmissibility β. Similarly, 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):
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 the symptomatic subpopulation to a given individual's propensity for exposure involves the mean transmissibility of the symptomatic individuals and the prevalence of symptomatic individuals in the overall population Isym/N. The contribution of pre- and asymptomatic infectious individuals involves the mean transmissibility of asymptomatic individuals and their prevalences (Ipre + Iasym)/N. Similarly, the contribution of infectious individuals in quarantine involves the transmissibility of quarantined individuals and their prevalences (Qsym + Qpre + Qasym)/N.
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 symptomatic, pre/asymptomatic, and quarantined infectious contacts to the propensity for exposure are handled separately using distinct sets of pairwise transmissibility parameters (βji, βAji, and βQji, respectively).
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 ExtSEIRSNetworkModel
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.
This model defines a population of interest as a set of individuals (nodes) and their contact network. It is typical to initialize such a population with some number of pre-existing cases and then simulate the transmission originating from those initial cases. However, it may also be of interest to consider the effect of ongoing introductions of the disease from outside the population of interest. For example an employee may become infected at home before and bring the disease into their workplace, or someone may interact with an infectious tourist from another city thereby introducing a new transmission chain into their community.
This framework offers two methods for modeling exogenous introductions, described below.
In this model, each individual interacts with another individual from outside their own population with probability o and with individuals within their own population with probability (1-o). The probabilities of well-mixed global interactions and network-based local interactions discussed above are relevant to within-population interactions only. By default it is assumed that o=0 and all interactions take place within the population of interest. However, setting o>0 allows individuals to interact with others outside of the population of interest, which can lead to new exogenous exposures.
These external contacts are assumed to be made with some well-mixed external population that has an infectious prevalence given by the parameter πext. The propensity of exogenous exposure is calculated in the same mean-field manner as global within-population exposure, but uses the external rather than within-population prevalence. It is assumed that the transmissibility of individuals in the external population is equal to the mean symptomatic transmissibility of individuals within the population of interest. Thus, the propensity for a given susceptible individual i to become exposed due to exogenous introduction is proportional to the product of that individual's susceptibility, the mean transmissibility of individuals in the population, and the prevalence of infectious individuals in the external population. It is possible for the external prevalence to change over the course of a simulation (see Changing parameters during a simulation for more information).
Alternatively, new cases can be introduced into a population by manually interfacing with the model code during a simulation. The ExtSEIRSNetworkModel
class includes a introduce_exposures()
function that can be called to expose a given number of randomly selected individuals at any point in a simulation. In addition, the compartment state of any node can be changed directly by modifying the model object's arguments at any time. A simulation loop that uses these model interfaces can effectively introduce cases to a population according to any arbitrary logic, such as at fixed time intervals, using a random poisson process, when some triggering event occurs, or according to other criteria. For an in-depth example of a simulation loop that implements these manual introduction features, see the TTI Simulation Loop.
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 can be modeled using the quarantine compartments and associated state transitions (highlighted arrows in diagram). Susceptible, exposed, pre-symptomatic, symptomatic, and asymptomatic individuals are tested at rates θS, θE, θpre, θsym, and θasym, respectively, and test positively for infection with probabilities (i.e., sensitivities) ψS, ψE, ψpre, ψsym, and ψasym, 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.
Note that this implementation assumes that individuals are tested randomly at exponentially distributed intervals corresponding to mean testing rates given by θS, θE, θpre, θsym, and θasym. More sophisticated testing and isolation protocols can be modeled using the manual testing features, described below.
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.
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 ψS, ψE, ψpre, ψsym, and ψasym, 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 φS, φE, φpre, φsym, and φasym. More sophisticated tracing protocols can be modeled using the manual tracing features, described below.
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 ExtSEIRSNetworkModel
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 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 ExtSEIRSNetworkModel
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 ExtSEIRSNetworkModel
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 ExtSEIRSNetworkModel
model object directly.
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 ExtSEIRSNetworkModel
class. The contact network can also be changed manually by updating the graph stored by a ExtSEIRSNetworkModel
model object directly in a user-defined simulation script.
- ⍺: susceptibility
- β: transmissibility (of symptomatic individuals)
- βA: transmissibility of pre- and asymptomatic individuals
- βQ: transmissibility of quarantined individuals
- σ: rate of progression to infectiousness (inverse of latent period)
- λ: rate of progression to (a)symptomatic state (inverse of pre-symptomatic period)
- a: probability of an infected individual remaining asymptomatic
- h: probability of a symptomatic individual being hospitalized
- η: rate of progression to hospitalized state (inverse of onset-to-admission period)
- γ: rate of recovery for non-hospitalized symptomatic individuals (inverse of symptomatic infectious period)
- γA: rate of recovery for asymptomatic individuals (inverse of asymptomatic infectious period)
- γH: rate of recovery hospitalized symptomatic individuals (inverse of hospitalized infectious period)
- f: probability of death for hospitalized individuals (case fatality rate)
- μH: 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 progression to (a)symptomatic state for quarantined individuals (inverse of pre-symptomatic period)
- γQS: rate of recovery for quarantined non-hospitalized symptomatic individuals (inverse of symptomatic infectious
- γQA: rate of recovery for non-hospitalized asymptomatic individuals (inverse of asymptomatic infectious period)
- ηQ: rate of progression to hospitalized state for quarantined individuals (inverse of onset-to-admission 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
- o: probability of interaction with member of external population (outside the population of interest)
- πext: prevalence of disease in external population (outside the population of interest)
- 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
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:
Extended SEIRS Model
Basic SEIRS Model
Simulation Demos