Presentation 1
Presentation 1
• Further insights
Some logistics (1)
https://www.niss.org/events/nissasa-tutorial-susceptible-infected-recovered-sir-modeling
Bjørnstad, O.N., Shea, K., Krzywinski, M. and Altman, N., "The SEIRS model for infectious disease dynamics."
Nature methods 17 (2020): 557-558.
with associated online Shiny App https://shiny.bcgsc.ca/posepi2/
All the data and functions to be discussed are in the R-package: https://CRAN.R-project.org/package=epimdr
OPEN SCIENCE: ALL material discussed is CC-NC-BY licensed (version 4.0 or higher), So grab it, monkey with it
repurpose, enhance and expand as long as its done with CC-NC-BY
Some logistics (2)
All the data and functions to be discussed are in the R-package: https://CRAN.R-project.org/package=epimdr
install.packages("epimdr")
install.packages("deSolve")
install.packages("shiny")
install.packages("polspline")
require("epimdr")
Bit of History
Measles Niamey, Niger 2003-2004
200
• MathEpi shorthand for a class of more or less complicated
150
compartmental models
Incidence
• Original SIR model by Kermack and McKendrick (1927) was a set of
100
elaborate integrodifferential renewal equations
• Are there laws for the shape of epidemics?
50
• Will everybody be infected?
0
• Bartlett 1957 Stoch Diff Eq versions 1 15 29 43 57 71 85 99 115 133 151 169 187 205 223
Day
• Bailey 1956 introduced discrete time (“chain-binomial”) stochastic
versions
Transmisssion rate, β
The simple S-I-R model
Transmisssion rate, β
In stable pop:
mu=nu
Change in I = + new infections – new recovered - deaths
When calculating we
usually set N = 1 so
each variable is the
fraction of population
#1 require(deSolve)
The recipe for integrating
the SIR ode’s (and other
#2 sirmod=function(t, y, parms){
ode’s in R)
S=y[1]; I=y[2]; R=y[3]
beta= parms["beta"]; mu= parms["mu"]
gamma= parms["gamma"]; N= parms["N"]
dS = mu * (N - S) - beta * S * I / N
Step1: require(deSolve) dI = beta * S * I / N - (mu + gamma) * I
Step2: gradient-function dR = gamma * I - mu * R
Step3: parameter values res=c(dS, dI, dR)
R0 determines
Further insights 2:
• S* = 1/R0
• “Natural herd immunity” does not exist – epidemic spread will slow as immunity builds up, but in
large cities will never go extinct unless vaccination or other interventions reduce R0 below 1.
Fraction infected
Fraction
Fraction susceptible
time
>>Shiny App
Invasion of rabies in
NE US raccoons
NY
1 Case
PA 15 Cases
30 Cases
VA
NC
Model elaborations (& R0)