SIR model. (Susceptible-Infected-Resistant/Removed) Outlook. Introduction into SIR model. Janusz Szwabiński

Similar documents
Diffusion processes on complex networks

Epidemics and information spreading

Mathematical Epidemiology Lecture 1. Matylda Jabłońska-Sabuka

Epidemic model for influenza A (H1N1)

Epidemics on networks

Introduction to SEIR Models

Epidemics in Networks Part 2 Compartmental Disease Models

ECS 289 / MAE 298, Lecture 7 April 22, Percolation and Epidemiology on Networks, Part 2 Searching on networks

Non-Linear Models Cont d: Infectious Diseases. Non-Linear Models Cont d: Infectious Diseases

Thursday. Threshold and Sensitivity Analysis

Section 8.1 Def. and Examp. Systems

Spotlight on Modeling: The Possum Plague

Mathematical Analysis of Epidemiological Models: Introduction

Epidemics on networks

Analysis of Numerical and Exact solutions of certain SIR and SIS Epidemic models

The Spreading of Epidemics in Complex Networks

Introduction to Epidemic Modeling

The SIRS Model Approach to Host/Parasite Relationships

Mathematical Modeling and Analysis of Infectious Disease Dynamics

CS224W: Analysis of Networks Jure Leskovec, Stanford University

Global Stability of a Computer Virus Model with Cure and Vertical Transmission

Lecture VI Introduction to complex networks. Santo Fortunato

University of Leeds. Project in Statistics. Math5004M. Epidemic Modelling. Supervisor: Dr Andrew J Baczkowski. Student: Ross Breckon

Epidemics in Complex Networks and Phase Transitions

(mathematical epidemiology)

Fixed Point Analysis of Kermack Mckendrick SIR Model

On the Spread of Epidemics in a Closed Heterogeneous Population

Copyright is owned by the Author of the thesis. Permission is given for a copy to be downloaded by an individual for the purpose of research and

Year 09 Science Learning Cycle 5 Overview

GEMF: GENERALIZED EPIDEMIC MODELING FRAMEWORK SOFTWARE IN PYTHON

CS 6604: Data Mining Large Networks and Time-series. B. Aditya Prakash Lecture #8: Epidemics: Thresholds

Qualitative Analysis of a Discrete SIR Epidemic Model

STABILITY ANALYSIS OF A GENERAL SIR EPIDEMIC MODEL

CLASSIFICATION UNIT GUIDE DUE WEDNESDAY 3/1

Dynamical models of HIV-AIDS e ect on population growth

Figure The Threshold Theorem of epidemiology

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Models of Infectious Disease Formal Demography Stanford Summer Short Course James Holland Jones, Instructor. August 15, 2005

Australian Journal of Basic and Applied Sciences

MATHEMATICAL MODELS Vol. III - Mathematical Models in Epidemiology - M. G. Roberts, J. A. P. Heesterbeek

Infectious Disease Modeling with Interpersonal Contact Patterns as a Heterogeneous Network

dy dt = a by y = a b

PARAMETER ESTIMATION IN EPIDEMIC MODELS: SIMPLIFIED FORMULAS

Applications in Biology

Time varying networks and the weakness of strong ties

Analysis with Variable Step Size Strategy of Some SIR Epidemic Models

A Note on the Spread of Infectious Diseases. in a Large Susceptible Population

MCMC 2: Lecture 2 Coding and output. Phil O Neill Theo Kypraios School of Mathematical Sciences University of Nottingham

Markov-modulated interactions in SIR epidemics

GLOBAL DYNAMICS OF A MATHEMATICAL MODEL OF TUBERCULOSIS

The Cultural Landscape: An Introduction to Human Geography, 10e (Rubenstein) Chapter 2 Population

A NEW SOLUTION OF SIR MODEL BY USING THE DIFFERENTIAL FRACTIONAL TRANSFORMATION METHOD

LAW OF LARGE NUMBERS FOR THE SIRS EPIDEMIC

Diffusion of information and social contagion

Project 1 Modeling of Epidemics

HETEROGENEOUS MIXING IN EPIDEMIC MODELS

Biological Models With Time Delay

Chapter 4 An Introduction to Networks in Epidemic Modeling

Modelling of the Hand-Foot-Mouth-Disease with the Carrier Population

Systems of Differential Equations

Mathematical modelling and controlling the dynamics of infectious diseases

Delay SIR Model with Nonlinear Incident Rate and Varying Total Population

Uncertainty Quantification of Epidemic Phenomena and the Parallel Simulator Tool

Stochastic modelling of epidemic spread

EARLY DETECTION OF BIOTERRORISM: MONITORING DISEASE USING AN AGENT-BASED MODEL

The death of an epidemic

Threshold Conditions in SIR STD Models

Control of Epidemics by Vaccination

Supplemental Information Population Dynamics of Epidemic and Endemic States of Drug-Resistance Emergence in Infectious Diseases

Kasetsart University Workshop. Mathematical modeling using calculus & differential equations concepts

ECS 289 F / MAE 298, Lecture 15 May 20, Diffusion, Cascades and Influence

On a stochastic epidemic SEIHR model and its diffusion approximation

APPM 2360 Lab 3: Zombies! Due April 27, 2017 by 11:59 pm

Mohammad Hessam Hessami. To cite this version: HAL Id: tel

Epidemiology. Schedule: Friday, 25 May. 9:30-11:00 Session 1 Basic models and in epidemiology. 11:30-13:00 Session 2 Tuberculosis, pertussis, malaria

COOPERATIVE EPIDEMIC SPREADING IN COMPLEX NETWORKS

Three Disguises of 1 x = e λx

Epidemiology, Equilibria, and Ebola: A Dynamical Analysis

Lecture 10. Under Attack!

Network Models in Epidemiology

Module 02 Control Systems Preliminaries, Intro to State Space

A New Mathematical Approach for. Rabies Endemy

Epidemic Models. Maaike Koninx July 12, Bachelor thesis Supervisor: dr. S.G. Cox

Modeling the Spread of Epidemic Cholera: an Age-Structured Model

arxiv: v1 [physics.soc-ph] 9 Nov 2012

Introduction To Simple Epidemic Models

Comment on A BINOMIAL MOMENT APPROXIMATION SCHEME FOR EPIDEMIC SPREADING IN NETWORKS in U.P.B. Sci. Bull., Series A, Vol. 76, Iss.

Approximation of epidemic models by diffusion processes and their statistical inferencedes

Essential Ideas of Mathematical Modeling in Population Dynamics

Discrete versus continuous-time models of malaria infections

Analytically tractable processes on networks

Disease Dynamics in Hive Populations

Networks as a tool for Complex systems

Growth Models 2/2/2015. Sequences. Sequences. Sequences. Example: How Many Terms are Enough? Sequences. Sequences and Population Sequences

Transmission in finite populations

Simulating stochastic epidemics

Qualitative Theory of Switched Integro-differential Equations with Applications

University of Minnesota Duluth Department of Mathematics and Statistics. Modeling of Ebola Control Strategies

2018 TANEY COUNTY HEALTH DEPARTMENT. Communicable Disease. Annual Report

Stability of SEIR Model of Infectious Diseases with Human Immunity

Transcription:

SIR model (Susceptible-Infected-Resistant/Removed) Janusz Szwabiński Outlook Introduction into SIR model Analytical approximation Numerical solution Numerical solution on a grid Simulation on networks Bibliography Introduction into SIR model http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 1/21

The impact of epidemics Plague of Athens epidemic which devastated the city-state of Athens in ancient Greece during the second year of the Peloponnesian War (430 BC) it is believed to have entered Athens through Piraeus much of the eastern Mediterranean also saw outbreak of the disease, albeit with less impact the plague returned twice more, in 429 BC and in the winter of 427/426 BC some 30 pathogens have been suggested as causing the plague, including typhus and typhoid Black death in Europe one of the most devastating pandemics in human history estimated 75 to 200 million people in Eurasia peaking in Europe in the years 1346 1353 estimated to have killed 30 60% of Europe's total population the plague may have reduced the world population from an estimated 450 million down to 350 375 million in the 14th century http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 2/21

HIV (Human Immunodeficiency Virus) estimated to have killed 20 million people in Africa since 1970s 1.1 million people died of HIV-related illnesses worldwide in 2015 (according to WHO) Native American disease and epidemics numerous diseases were brought to North America by European, including Bubonic plague, chickenpox, cholera, the common cold, diphtheria, influenza, malaria, measles, scarlet fever, sexually transmitted diseases, typhoid, typhus, tuberculosis, and pertussis each of these brought destruction through sweeping epidemics native Americans had not built up internal immunities to the diseases or formed any medicines to combat them http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 3/21

1918 flu pandemic January 1918 December 1920 the first of the two pandemics involving H1N1 influenza virus it infected 500 million people across the world and resulted in the deaths of 50 to 100 million (three to five percent of the world's population) it reduced life expentancy (e.g. by 12 years in the USA) SIR model models are imprtant for our understanding of epidemic spreading first appeared already in 1920s first models based on differential equations modern approaches relies on computer simulations (microscopic analysis) SIR model was proposed by W. O. Kermack abd A. G. McKendrick in 1927 one of the simplest models of epidemics applicable to specific diseases like measles (pl. odra), pertussis (pl. krztusiec) or HIV, i.e. to diseases for which individuals die or develop immunity after they recover from the infection relies on the concepts of compartmentalization and homogenous mixing compartmentalization means classifying each individual based on the stage of the disease affecting them: Susceptible (S) - healthy individuals who have not yet contacted the pathogen Infectious (I) - contagious individuals who have contacted the pathogen and hence can infect others http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 4/21

Recovered (R) - individuals who have been infected before, but have recovered from the disease, hence are not infectious homogenous mixing hypothesis assumes that each individual has the same chance of coming into contact with an infected individual. (Source: A.-L. Barabasi, Network science ) ds(t) dt di(t) dt dr(t) dt = βi(t)s(t) = βi(t)s(t) γi(t) = γi(t) where: β - transmission rate γ - recovery rate Analytical approximation http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 5/21

Taking the time derivative of the above equations and performing multiple insertions we arrive at 2 We obtained a nonlinear differential equation for, which cannot be solved exactly. However, by making some assumptions we may still extract some useful informations from the original set of equations. First of all, it should be noted that just after the outbreak the numbers of susceptibles and infected will be very close to their initial values and, respectively. Thus where and δ I S 0. Inserting the above into the model and neglecting the terms of higher orders we obtain: d δ S (t) = β S 0 δ I (t) dt Since δ S / S 0 1 / 1 d 2 S(t) 1 ds(t) ds(t) = (βs(t) γ) dt 2 ( ) S dt 0 0 S(t) I(t) d δ I dt (t) S(t), from the second equation it follows: dt S 0 δ S (t) δ I (t) = β S 0 δ I (t) γ δ I (t) I(t = 0) = I 0 (β γ)t I(t) = δ I (t) = I 0 e S 0 This approximation is reasonable only if δ I stays small, i.e. if βs 0 γ 0 β γ S 0 In other words, the disease cannot be very contagious, i.e. the number of susceptibles will change only little with time. Using the solution for from the first equation we get: Note that for the number of healthy individuals goes to some fixed value S, t Now we want to plot S as a function of β: δ I βs 0 I 0 (βs δ S (t) = ( 0 γ)t 1) e βs 0 γ (1 + ) βi 0 S S 0 βs 0 γ In [26]: %matplotlib inline import matplotlib.pyplot as plt import numpy as np http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 6/21

In [31]: gamma = 1.0 S0 = 100.0 I0 = 1.0 bvals = np.linspace(0.0,0.01,100) x = bvals*s0-gamma Sapp = S0*(1+bvals*I0/(bvals*S0-gamma)) plt.plot(x,sapp,label=r"$s_{approx}$") plt.xlabel(r"$\beta S_0-\gamma$",fontsize=18) plt.ylabel(r"$s_{\infty}$",fontsize=18) plt.xlim([-1.0,0]) plt.ylim([80,100]) plt.legend(fontsize=18) plt.show() /usr/local/lib/python3.5/dist-packages/ipykernel/ main.py:7: Runt imewarning: divide by zero encountered in true_divide Numerical solution Usually we have to resort to numerical methods in order to solve sets of nonlinear differential equations. To this end, we write down our set in the following matrix form: u S (t) (t) = I (t) = R (t) βi(t)s(t) βi(t)s(t) γi(t) γi(t) http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 7/21

In [32]: def rhs(u,t): S = u[0] I = u[1] R = u[2] return np.array([-beta*i*s,beta*i*s-gamma*i,gamma*i]) In [40]: from scipy.integrate import odeint gamma = 1.0 I0 = 1.0 S0 = 100.0 init= [S0,I0,0.0] bvals = [0.01,0.02,0.03] t = np.linspace(0,100,1000) fig, axes = plt.subplots(1, 3,figsize=(15,4)) for i in range(len(bvals)): beta = bvals[i] u = odeint(rhs,init,t) axes[i].plot(t,u[:,0],label="$s$") axes[i].plot(t,u[:,1],label="$i$") axes[i].plot(t,u[:,2],label="$r$") axes[i].set_title(r"$\beta = $"+str(beta),fontsize=16) axes[i].set_xlabel(r"$t$",fontsize=16) axes[i].set_ylabel(r"$s/i/r$",fontsize=16) axes[i].legend(loc=5,fontsize=12) axes[i].set_xlim([0,20]) plt.tight_layout() plt.show() http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 8/21

Some experimental data for comparisons: </table> A. M. Correia, F. C. Mena, and A. J. Soares, An Application of the SIR Model to the Evolution of Epidemics in Portugal, in Dynamics, Games and Science II Now we want to compare the analytic approximation with the numerical results: In [41]: In [42]: In line with our assumptions, the agreement is very good for small values of β. It is interesting to look at the numerical solution for larger values of β as well: In [43]: http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 9/21

In [44]: The point βs 0 γ = 0 marks the transition between an initially decaying and growing number of infected agents, and this is marked by a relatively sudden change in behaviour. The disease can properly take hold and gain some momentum in the growing case, and the number of infections increases rapidly. Numerical solution on a grid The above approach give already some insight into the dynamics of epidemics, but it is fairly limited in scope. All of the agents are assumed to be able to interact with one another, perhaps representing a population trapped in the same room. To extend this model, lets assume there are populations spread out on a grid,,, where represent indices in a 2D array. The model equations are the S i,j I i,j R i,j (i, j) same, except we allow neighbouring grid cells to interact with one another so infection can spread from cell to cell, i.e. S i u i (t) = = I i R i β ( S + + + + ) i,j I i,j S i,j I i 1,j S i,j I i+1,j S i,j I i,j 1 S i,j I i,j+1 β ( + + + + ) γ S i,j I i,j S i,j I i 1,j S i,j I i+1,j S i,j I i,j 1 S i,j I i,j+1 I i,j γi i,j http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 10/21

One often uses Perlin noise to generate random maps of initial population densities: However, it is possible to use demographical data for the initital conditions. Let us consider for instance the following density population map for Poland: http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 11/21

We remove the legend and convert it into grayscales with a software like GIMP: We are ready to read the map and convert it into a numpy array: http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 12/21

In [45]: (362, 379, 3) The function odeint used before allows us to find a solution of a given set of differential equation over some time interval. However it is not the best choice for monitoring the time evolution of a system step by step. In this case it is better to use a method which provides a solution at time step n + 1 given the solution at prevoius time step/steps. The simplest (and worst) possibility is the so called Euler method. Remember the definition of a derivative? u (t) = u (t + Δt) u (t) lim Δt 0 Δt With some rearranging it can actually be used to approximate the next step of the function when the derivative is known and Δt is assumed to be small. Since our set of equations may be written as u (t) = f(u) then for small Δt we get u n+1 = + Δt f(u) u n The biggest advantage of this method is its simplicity: In [55]: http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 13/21

Unfortunately, this method is only conditionally stable and inaccurate. Thus it is better to resorts to the modified Euler method, also known as the Runge-Kutta method of the second order: In [56]: u n+1 u n+1 = + Δt f(u) u n Δt = u n + {f( u n ) + f( u )} 2 n+1 Recall the equation to solve: S i u i (t) = = I i R i β ( S + + + + ) i,j I i,j S i,j I i 1,j S i,j I i+1,j S i,j I i,j 1 S i,j I i,j+1 β ( + + + + ) γ S i,j I i,j S i,j I i 1,j S i,j I i+1,j S i,j I i,j 1 S i,j I i,j+1 I i,j γi i,j First we need a function defining the right hand side of the above set: In [48]: At all population belongs to the susceptible category S. There are neither infected no recovered individuals in the system: t = 0 In [57]: We inject an infected person somewhere in central Poland: In [58]: Let us initialize the simulation: In [60]: Then we simulate the system In [61]: and save the solution for each step into a png file: In [62]: The png files are used to prepare an animated gif: In [63]: http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 14/21

Simulations on networks Beside the characteristics of a pathogen, the interactions within a population are very important for the disease spreading. http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 15/21

Measles Viral hepatitis http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 16/21

23.05.2017 sir_model Social and transport networks give some insights into the directions of spreading. However, it is important to find the contact network for a given pathogen, because it defines the transmission chanels of the disease. Challenges in determining a contact network requires knowledge of all individuals and their interactions within a population possible only for small populations in a finite time if sampling possible, two problems: people are reluctant to disclose some information (e.g. sexual contacts) how to define an edge? For instance, how long does it take to catch a flu virus if in contact with an infected person? http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 17/21

Common techniques to determine contact networks: infection tracking - identifying the source of infection (patient "zero"), then people who caught the infection from him etc. tree-like network (cascading process) contact tracking - for a given person you look for all potential contacts (again, problems with the definition of a contact) diary analysis - ill people try to chronologically reproduce the list of their contacts http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 18/21

SIR model on networks After determining the network structure, the actual simulation is pretty simple. D. Easley, J. Kleinberg, Networks, Crowds and Markets: Reasoning about a Highly Connected World Very often one uses artificial network models to understand the impact of some network characteristics on the spreading: </table> Keeling MJ, Eames KTD (2005) Networks and epidemic models. J R Soc Interface 2: 295 307. http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 19/21

One of the most important results of such simulations is that one concerning the epidemic threshold - there is no such threshold on scale-free networks. In this case the disease spreads quickly over the entire network. R. Pastor-Satorras and A. Vespignani, PRL 86, 3200 (2001) Here, the parameter λ is the basic reproduction number, defined as λ = β γ Such simulations are of course possible in Python, in particular in connection with the networkx module. It should be noted however that due to efficiency limitations of Python one may be forced to resort to compiled languages like C/C++ or Fortran in case of very large networks. In [64]: In [75]: In [76]: http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 20/21

Bibliography 1. Daley, D. J. & Gani, J. (2005). Epidemic Modeling: An Introduction. NY: Cambridge University Press. 2. Going Viral, http://jasmcole.com/2014/10/19/going-viral/ (http://jasmcole.com/2014/10/19/goingviral/) 3. Max Berggren, Model of a zombie outbreak in Sweden, Norway and Finland (Denmark is fine), http://maxberggren.se/2014/11/27/model-of-a-zombie-outbreak/ (http://maxberggren.se/2014/11/27/model-of-a-zombie-outbreak/) 4. http://matplotlib.org/ (http://matplotlib.org/) 5. https://networkx.github.io/ (https://networkx.github.io/) http://localhost:8888/nbconvert/html/sir_model.ipynb?download=false 21/21