The Computational Modeling of Infectious Disease

Over the last two decades, a wealth of new computational tools have emerged to tackle public health challenges with quantitative approaches. The COVID-19 pandemic has shown that data and analytics will be key pillars of responding to such outbreaks in the future. Yet there are very few works on the market that prepare epidemiologists, computer scientists and data scientists to model infectious disease processes in practice.

Why another book on computational/mathematical epidemiology?

There are lots of wonderful books out there on mathematical epidemiology. However, few of these books draw the three strands of epidemiology, computational methods and mathematics together in an end-to-end fashion.

The purpose of this book is to change that, and give you the tools for end-to-end analysis of infectious disease dynamics using computational methods. Richly illustrated with code examples in Python (also available as companion notebooks, which will be released together with the book on Github), The Computational Modeling of Infectious Disease is both a guided tour through computational infectious disease epidemiology and a reference work for practitioners in the field.

Who is this book for?

A lot of books in this field are directed at mathematicians, or those aspiring to be mathematicians. This is understandable–much of infectious disease modeling is done by mathematicians, after all. Yet there’s a growing need to equip data scientists, analysts, epidemiologists, GIS experts and others who don’t necessarily want (or need) to be able to derive Lyapunov functions in their sleep.1)

In the same vein, this is not just a book about the mathematics of infectious disease, but also about the computational solution of problems in predicting and modeling infectious disease. Mathematical examples are accompanied by code examples in Python.

Why Python?

Currently, most of the books in this field are written with reference to MATLAB, if anything, with one book each using Berkeley Madonna and R. This book uses Python for three reasons:

  • In recent years, Python has become the lingua franca of data science, and for data-driven modeling, it offers ‘batteries included’ with packages like pandas and NumPy.
  • Python is also relatively legible language with few, if any, features that are not supported by other languages. If you want to reimplement a code example in, say, Haskell, you are going to have a much easier time than the other way around.
  • Finally, the package ecosystem for Python is amazing. Though nowhere near as rich as R’s (if it exists and it’s a statistical method, chances are there is an R implementation!), there are some outstanding packages that we will be making use of.

If you are new to Python, don’t despair–we will be using a very small subset of the language. Packages like NumPy, pandas, Statsmodels, SciPy and SymPy will do the heavy lifting for us, and Python is only the language we use to traffic objects between them.

Table of contents

  • Introduction
    Why we model infectious disease · What this book is about · Who this book is for · What this book is not about · How to use this book
  • Simple compartmental models
    The intuition of compartmental models · Modeling vital dynamics · Models of immunity · Models with latent periods, asymptomatic infection and carrier states · Estimating parameters
  • Modeling host factors
    Heterogeneity of transmission risk · Superspreading and supershedding · Semi-discrete heterogeneities · Discretised continuous heterogeneities · Continuous heterogeneities
  • Host-vector systems
    Exclusively vector-borne diseases · Human-transmissible zoonotic disease · Complex zoonotic disease
  • Multi-pathogen systems
    Multi-pathogen systems without cross-immunity · Multi-pathogen systems with cross-immunity · Competitive dynamics
  • Modeling the control of infectious disease
    Modeling vaccination · Duration and effectiveness of vaccine-induced immunity · Isolation and quarantine
  • Spatial models of infectious disease
    Spatial compartmental models · Metapopulations · Discrete-space models · Continuous-space models
  • Agent-based models
    The fundamentals of agent-based modeling · Discrete-space agent-based models · Special forms of movement in continuous-space agent-based models · Network agent-based models


The Computational Modeling of Infectious Disease is expected to be available in early 2022, in print and eBook formats. A rights-protected open access version will always be available.


1 Although the book does discuss Lyapunov functions in enough depth in case that is what you want to do with your life.