This is the companion repository for The Computational Modeling of Infectious Disease by Chris von Csefalvay.

Buy the book

Table of contents

Chapter Computational Note    
1   Introduction  
2   Simple compartmental models  
  2.1 ODE solvers  
  2.2 Solving ODEs in Python  
  2.3 Phase portraits  
  2.4 Setting initial parameters  
  2.5 Waning immunity  
  2.6 Solving SEIR models  
  2.7 Solving SIRC models  
  2.8 Solving SIRC models with reduced infectiousness  
  2.9 Symbolic computation of R_0 in a complex model  
  2.10 Contact tracing data with NetworkX  
  2.11 Symbolic determination of the moment-generation function  
  2.12 Estimating R_t  
  2.13 Multi-parameter estimation with lmfit and Emcee  
    Funerary transmission  
3   Host factors  
  3.1 Calculating the R_0 of complex stratified models  
  3.2 Calculating the mixing matrix from a contact network  
  3.3 Age differential SIR model  
  3.4 Inference of mixing matrices  
  3.5 Subcompartmental models  
  (Fig. 3.2) Risk-stratified SIR model and coupling  
4   Host-vector and multi-host interactions  
  4.1 Implementing the Ross-MacDonald model  
  4.2 Creating streamplots  
  4.3 Inferring parameters for a vector-borne disease  
  4.4 Managing complex models with structures  
  4.5 Time dependence in ODE solvers  
5   Multi-pathogen dynamics  
  5.1 Solving multi-pathogen compartmental models with transition matrices  
  5.2 Modeling the no-coinfection no-cross immunity interaction  
    Complete cross-immunity  
    No-coinfection no-cross immunity simplified  
6   Modeling the control of infectious disease  
  6.1 Targeted vaccination  
  6.2 Solving delay differential equations computationally  
  6.3 Modeling the effect of different quarantine regimes  
  6.4 Iterative stateful evaluation  
7   Temporal dynamics of epidemics  
  7.1 Symbolic identification of equilibria  
  7.2 Numeric equilibrium of a SIR model  
  7.3 Symbolic equilibrium analysis of SEIR models  
  7.4 Time series decomposition  
  7.5 Plotting time series decompositions  
  7.6 Continuous Wavelet spectral analysis  
  7.7 Discrete Lyapunov exponents to estimate chaos  
    Birth pulsing  
    Sinusoidal temporal forcing  
8   Spatial dynamics of epidemics  
  8.1 Simple spatial lattices  
  8.2 Indexing and manipulation of multi-dimensional arrays  
  8.3 Kernel neighbourhoods  
  8.4 A neighbourhood model of influence  
  8.5 Minimum-filtered spatial lattice  
  8.6 Spatial autocorrelation of COVID-19  
  8.7 Modeling the pandemic that never was  
  8.8 Access and distance  
  8.9 Placing testing sites in Manhattan  
  8.10 Nested interdiction  
9   Agent-based modeling  
  9.1 Using Mesa  
  9.2 Initialising the model  
  9.3 Using enumerations to define states  
  9.4 Creating the Agent blueprint  
  9.5 Probabilistic steps in ABMs  
  9.6 Creating the infectious process  
  9.7 Networks in Mesa  
  9.8 Activations in Mesa  
  9.9 The Model class and parametrising the ABM  
  9.10 Collection and export from ABMs  
  9.11 Creating seed populations  
  9.12 Iterative running of ABMs  
  9.13 The q infector  
  9.14 An ABM for pure vector-borne disease  
  9.15 SI-SIRD epidemic competition  
  9.16 Competing pathogens with a modal shift  
  9.17 Quarantine modeling  
  9.18 Vaccination and peer influence  
  9.19 Targeted prophylaxis  
  9.20 Modeling anti-vaccine sentiment  
  9.21 ABM of treatment effects  
  9.22 A spatial graph with movement  
  9.23 Homesick random-destination walks  
    Healthcare capacity contingent mortality