Source-linked AI summary
EoN (Epidemics on Networks): a fast, flexible Python package for simulation, analytic approximation, and analysis of epidemics on networks
Joel C. Miller, Tony TIng
TL;DR
EoN addresses the need for tools to study infectious processes spreading through networks with a Python package offering simulation and analysis methods. Its examples include large-scale SIR simulation and a complex-contagion threshold cascade, while illustrating a memoryless constraint on complex contagion.
Problem
The paper presents tools for studying infectious processes spreading through networks.
Source: Introduction · p. 1Method
EoN is a pure-Python package with over 100 user functions, including stochastic simulation of SIS, SIR, and simple and complex contagions.
Source: Introduction · pp. 1–2Results
For the complex-contagion example, once the initial infected proportion exceeds a threshold, a global cascade infects almost every individual.
Source: Example · p. 20Takeaways & Limitations
The examples demonstrate only a fraction of the possibilities offered by EoN's tools for studying infectious processes in contact networks.
Source: Discussion · p. 25The complex-contagion implementation has no memory: transitions depend on neighbors' current statuses, not past interactions.
Source: Complex contagions · p. 17
Abstract
from arXiv · showhide
We provide a description of the Epidemics on Networks (EoN) python package designed for studying disease spread in static networks. The package consists of over $100$ methods available for users to perform stochastic simulation of a range of different processes including SIS and SIR disease, and generic simple or comlex contagions.
Introduction
EoN is a pure-Python package with over 100 user functions for studying infectious processes on networks. It supports disease and contagion simulation, differential-equation models, and visualization and analysis of stochastic simulations.
Introduction
- EoN is a pure-Python package with over 100 user functions for studying infectious processes spreading through networks.It grew out of Mathematics of Epidemics on Networks.Source: Introduction · p. 1
- Its disease tools cover SIS and SIR processes, including stochastic simulation and numerical solution of more than 20 differential-equation models.Source: Introduction · p. 1
- The package supports stochastic simulation of a wide range of simple and complex contagions.Source: Introduction · p. 2
- EoN also provides tools to visualize and analyze stochastic simulations.Source: Introduction · p. 2
SIR and SIS disease
EoN supports stochastic SIS and SIR simulations across several dynamics, alongside approximately 20 differential-equation models for network disease spread. The examples illustrate simulation performance and models that use different network information and assumptions.
Stochastic simulation
- The stochastic tools cover Markovian and non-Markovian continuous-time SIS and SIR, discrete-time variants, and rates dependent on individual or partnership properties.Gillespie and event-driven implementations have comparable speed for Markovian dynamics, while event-driven methods also handle non-Markovian dynamics.Source: Stochastic simulation · pp. 2–3
- SIR algorithms typically handle hundreds of thousands of individuals in well under a minute on a laptop; SIS runs are slower because they often involve more events.Source: Stochastic simulation · p. 3
- On a million-person example, fast SIR and Gillespie SIR ran in time comparable to graph generation and affected around 28% of the population.Source: Examples · p. 4
Differential Equations Models
- EoN numerically solves approximately 20 SIS or SIR differential-equation models, whose deterministic predictions use different network information.Models may accept network properties as inputs or take a network and measure those properties.Source: Differential Equations Models · p. 7
- The examples demonstrate an SIS homogeneous pairwise model tracking [SI] and [SS] pairs, and an SIR edge-based model assuming partnerships are as random as possible given the degree distribution.The edge-based model uses a generating function based on the initial susceptible degree distribution.Source: Examples · pp. 7, 9
- Differential-equation outputs are expected numbers of individuals in each status, and setting N=1 yields proportions instead.Source: Examples · pp. 9–10
Simple and Complex Contagions
The section distinguishes simple contagions, whose status-change rates are unaffected by other partners’ statuses, from complex contagions, whose rates may depend on multiple partners. Both are implemented in a Gillespie setting requiring Markovian assumptions, though bespoke algorithms may be significantly faster.
Simple and Complex Contagions
- Simple contagions change status at a partner-independent rate, while complex contagion rates may depend on partners’ statuses, including multiple infected partners acting together.SIS and SIR diseases are special cases of simple contagions.Source: Simple and Complex Contagions · p. 10
- Simple and complex contagions are implemented only with Gillespie simulations and therefore require Markovian assumptions.Source: Simple and Complex Contagions · p. 10
- Bespoke algorithms may be feasible and run significantly faster than the package’s contagion implementations.Source: Simple and Complex Contagions · p. 11
Simple contagions
This section presents EoN workflows for simulating and analyzing simple and complex contagions, with process-specific transition rules and examples of cooperative epidemics and threshold cascades. It also demonstrates tools for examining simulation histories, transmission patterns, status counts, and epidemic dynamics, including an SIRV example on a lattice.
Simple contagions
- EoN’s Gillespie_simple_contagion lets users specify arbitrary simple contagions by separating spontaneous individual transitions from partner-induced transitions.Spontaneous transitions are represented on a status graph H, while partner-induced transitions use a graph J of status pairs; an induced transition leaves the first partner’s status unchanged.Source: Simple contagions · pp. 11–12
- Two cooperative SIR diseases that would each fail to start an epidemic in isolation can jointly spread and sometimes exhibit oscillatory behavior.The example uses an asymmetric initial condition to stimulate oscillations, though stochastic effects can induce them with smaller initial conditions.Source: Examples · p. 14
Complex contagions
- Complex contagions are simulated without memory using user-defined functions for transition rates, new statuses, and nodes whose rates may change.A node’s transition depends on its neighbors’ current statuses, not on past interactions with neighbors who have since changed status.Source: Complex contagions · p. 17
- Once the initial infected proportion exceeds a threshold, a global cascade infects almost everyone; below it, the final size is comparable to the initial size.This threshold behavior is shown for the complex contagion simulation.Source: Example · p. 20
- The initial proportion needed to trigger a cascade is smaller in a random clustered network than in the comparison network with the same degree distribution.The clustered-network result is described as similar to Fig. 8a of.Source: Example · p. 20
Visualization & Analysis
- Full-data simulation objects can reconstruct individual statuses and transmission histories, but complex contagions do not provide transmission trees because the inducing individual cannot be identified.The objects also support network snapshots, time-series displays, and animations.Source: Visualization & Analysis · p. 21
- EoN exposes transmission trees as NetworkX directed graphs that can be laid out and plotted.The example uses EoN.hierarchy_pos for the layout.Source: Example - a snapshot of dynamics and a… · p. 22
- The SIRV example models random spontaneous vaccination of susceptible individuals without regard to neighbors and uses Gillespie simple contagion on a lattice.Its transitions include Sus to Vac at rate 0.01, Inf to Rec at rate 1.0, and induced infection at rate 2.0.Source: Example - Visualizing dynamics of SIR… · pp. 23–24
- Simulation summaries return times and status-count arrays, which users can combine into aggregate time series such as Sus+Vac and Inf+Rec.The example adds those aggregates to the simulation for plotting.Source: Example - Visualizing dynamics of SIR… · p. 24
- EoN can display a simulation snapshot and animate the displayed dynamics over calculated times, saving the animation as an MP4 file.The example displays the SIRV simulation at time 6; required encoding arguments may depend on the computer installation.Source: Example - Visualizing dynamics of SIR… · pp. 24–25
Discussion
EoN provides tools for studying infectious processes in contact networks; the examples demonstrate only a fraction of the package’s possibilities.
- The examples demonstrate EoN’s range of tools for infectious processes in contact networks, but cover only a fraction of its possibilities.Source: Discussion · p. 25
Dependencies
The listed dependencies are SciPy, NumPy, NetworkX, and Matplotlib.
- The listed dependencies are SciPy, NumPy, NetworkX, and Matplotlib.Source: Dependencies · p. 25
Related Packages
The paper reviews alternative software for simulating epidemics on networks, covering Python packages and an R package. Their supported disease models and implementation scope differ.
Related Packages
- The section reviews alternative software packages for simulating epidemics on networks.Source: Related Packages · p. 25
epydemic
- Epydemic simulates network SIS and SIR epidemics and supports additional models simulable with EoN.simple contagion.Source: epydemic · pp. 25–26
Graph-tool
- Graph-tool offers built-in SIS, SIR, and SIRS models, but its disease models are currently discrete-time only.Source: Graph-tool · p. 26
EpiModel
- EpiModel, an R package built around StatNet, handles SI, SIS, and SIR spread and can be extended to other models.Source: EpiModel · p. 26