modeling frameworks
DESCRIPTION
Modeling frameworks. Today, compare:Deterministic Compartmental Models (DCM) Stochastic Pairwise Models (SPM) for (I, SI, SIR, SIS) R est of the week: Focus on Stochastic Network Models. Deterministic Compartmental Modeling. Susceptible. Infected. Recovered. - PowerPoint PPT PresentationTRANSCRIPT
UW - NME 2013 1
Modeling frameworks
Today, compare: Deterministic Compartmental Models (DCM)Stochastic Pairwise Models (SPM)
for (I, SI, SIR, SIS)
Rest of the week: Focus on Stochastic Network Models
8-13 July 2013
UW - NME 2013 2
Deterministic Compartmental Modeling
Susceptible Infected Recovered
8-13 July 2013
UW - NME 2013
โข A form of dynamic modeling in which people are divided up into a limited number of โcompartments.โโข Compartments may differ from each other on any variable that is of epidemiological relevance (e.g. susceptible vs. infected, male vs. female).โข Within each compartment, people are considered to be homogeneous, and considered only in the aggregate.
Compartmental Modeling
Compartment 1
38-13 July 2013
UW - NME 2013
โข People can move between compartments along โflowsโ. โข Flows represent different phenomena depending on the compartments that they connectโข Flow can also come in from outside the model, or move out of the modelโข Most flows are typically a function of the size of compartments
Compartmental Modeling
Susceptible Infected
48-13 July 2013
UW - NME 2013
โข May be discrete time or continuous time: we will focus on discreteโข The approach is usually deterministic โ one will get the exact same results from a model each time one runs itโข Measures are always of EXPECTED counts โ that is, the average you would expect across many different stochastic runs, if you did themโข This means that compartments do not have to represent whole numbers of people.
58-13 July 2013
Compartmental Modeling
UW - NME 2013
Constant-growth model
Infected population
t = timei(t) = expected number of infected people at time tk = average growth (in number of people) per time period
68-13 July 2013
UW - NME 2013
recurrence equation
difference equation(three different notations for the same concept โ keep all in mind when reading the literature!)
7
๐ (๐ก+1 )=๐ (๐ก )+๐๐ (๐ก+1 )โ๐ (๐ก )=๐๐๐/๐๐ก=๐โ ๐=๐
๐ (๐ก+2 )=๐ (๐ก+1 )+๐๐ (๐ก+2 )=๐ (๐ก )+๐+๐
๐ (๐ก+1 )=๐ (๐ก )+๐
๐ (๐ก+2 )=๐ (๐ก )+2๐
๐ (๐ก+3 )=๐ (๐ก+2 )+๐๐ (๐ก+3 )=๐ (๐ก )+2๐+๐๐ (๐ก+3 )=๐ (๐ก )+3๐
๐ (๐ก+๐ฅ )=๐ (๐ก )+๐ฅ๐8-13 July 2013
Constant-growth model
UW - NME 2013
Example: Constant-growth modeli(0) = 0; k = 7
0.00
20.00
40.00
60.00
80.00
100.00
120.00
140.00
160.00
0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48
Time
Com
part
men
t Siz
e
88-13 July 2013
UW - NME 2013
Proportional growth model
Infected population
t = timei(t) = expected number of infected people at time tr = average growth rate per time period
recurrence equation
difference equation
9
๐ (๐ก+1 )=๐ (๐ก )+๐๐(๐ก)๐ (๐ก+1 )โ๐ (๐ก )=๐๐(๐ก)๐ (๐ก+๐ฅ )=๐(๐ก )(1+๐ )๐ฅ
8-13 July 2013
UW - NME 2013
Example: Proportional-growth modeli(1) = 1; r = 0.3
108-13 July 2013
UW - NME 2013
Susceptible Infected
New infections per unit time (incidence)
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t
What is the expected incidence per unit time?
118-13 July 2013
SI model
UW - NME 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
Expected incidence at time t
12
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t
8-13 July 2013
SI model
UW - NME 2013
SI model
Expected incidence at time t
13
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t
8-13 July 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
UW - NME 2013
SI model
Expected incidence at time t
14
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t = act rate per unit time
8-13 July 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
UW - NME 2013
Expected incidence at time t
15
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t = act rate per unit time
8-13 July 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
SI model
UW - NME 2013
SI model
Expected incidence at time t
16
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t = act rate per unit time = โtransmissibilityโ = prob. of transmission given S-I act
8-13 July 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
UW - NME 2013
SI model
Expected incidence at time t
17
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t = act rate per unit time = โtransmissibilityโ = prob. of transmission given S-I actn(t) = total population = s(t) + i(t)
8-13 July 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
UW - NME 2013
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time t = act rate per unit time = โtransmissibilityโ = prob. of transmission given S-I actn(t) = total population = s(t) + i(t) = n
Careful: only because this is a โclosedโ population
SI model
Expected incidence at time t
188-13 July 2013
A new infection requires: a susceptible person to have an act with an infected person and for infection to transmit because of that act
UW - NME 2013
Susceptible Infected
What does this mean for our system of equations?
Expected incidence at time t
19
8-13 July 2013
SI model
UW - NME 2013
Susceptible Infected
What does this mean for our system of equations?
Expected incidence at time t
๐ (๐ก+1 )=๐ (๐ก )โ๐ (๐ก )๐ผ ๐ (๐ก )๐ ๐
๐ (๐ก+1 )=๐ (๐ก )+๐ (๐ก )๐ผ ๐ (๐ก )๐ ๐
20
8-13 July 2013
SI model
UW - NME 2013
Remember:
constant-growth model could be expressed as:
proportional-growth model could be expressed as:
SI model - Recurrence equations
21
๐ (๐ก+๐ฅ )=๐ (๐ก )+๐ฅ๐
๐ (๐ก+๐ฅ )=๐(๐ก)(1+๐ )๐ฅ
The SI model is very simple, but already too difficult to express as a simple recurrence equation.
Solving iteratively by hand (or rather, by computer) is necessary
8-13 July 2013
UW - NME 2013 22
Susceptible Infected
SIR model
t = times(t) = expected number of susceptible people at time ti(t) = expected number of infected people at time tr(t) = expected number of recovered people at time t = act rate per unit time = prob. of transmission given S-I actr = recovery rate
Recovered
What if infected people can recover with immunity?
And let us assume they all do so at the same rate:
8-13 July 2013
UW - NME 2013 23
Relationship between duration and recovery rateImagine that a disease has a constant recover rate of 0.2. That is, on the first day of infection, you have a 20% probability of recovering. If you donโt recover the first day, you then have a 20% probability of recovering on Day 2. Etc.
Now, imagine 100 people who start out sick on the same day.
โข How many recover after being infected 1 day?โข How many recover after being infected 2 days?โข How many recover after being infected 3 days?โข What does the distribution of time spent infected look like?โข What is this distribution called?โข What is the mean (expected) duration spent sick?
8-13 July 2013
100*0.2 = 20 80*0.2 = 16 64*0.2 = 12.8Right-tailedGeometric5 days ( = 1/.2)D = 1/ r
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3305
10152025
UW - NME 2013 24
Expected number of new infections at time t still equals
where n now equals
Expected number of recoveries at time t equals
So full set of equations equals:
SIR model
๐ (๐ก+1 )=๐ (๐ก )โ๐ (๐ก )๐ผ ๐ (๐ก )๐ ๐
๐ (๐ก+1 )=๐ (๐ก )+๐ (๐ก )๐ผ ๐ (๐ก )๐ ๐โ ๐ ๐ (๐ก )
๐ (๐ก+1 )=๐ (๐ก )+๐ ๐ (๐ก )
8-13 July 2013
UW - NME 2013 25
SIR model = 0.6, = 0.3, = 0.1
Initial population sizes s(0)=299; i(0)=1; r(0) = 0
susceptible
infected
recovered
What happens on Day 62? Why?
8-13 July 2013
UW - NME 2013 26
R0 = the number of direct infections occurring as a result of a single infection in a susceptible population โ that is, one that has not experienced the disease before
We saw earlier that R0 = . So for the basic SIR model, it also equals /
Tells one whether an epidemic is likely to occur or not:
โข If R0 > 1, then a single infected individual in the population will on average infect more than one person before ceasing to be infected. In a deterministic model, the disease will grow
โข If R0 < 1, then a single infected individual in the population will on average infect less than one person before ceasing to be infected. In a deterministic model, the disease will fade away
โข If R0 = 1, we are right on the threshold between an epidemic and not. In a deterministic model, the disease will putter along
Qualitative analysis pt 1:Epidemic potential
Using the SIR model
8-13 July 2013
UW - NME 2013 27
SIR model = 4, = 0.2, = 0.2
Initial population sizes s(0)=999; i(0)=1; r(0) = 0
R0 = / = (4)(0.2)/(0.2) = 4
Compartment sizes Flow sizes
SusceptibleInfectedRecovered
Transmissions (incidence)Recoveries
8-13 July 2013
UW - NME 2013 28
SIR model = 4, = 0.2, = 0.8
Initial population sizes s(0)=999; i(0)=1; r(0) = 0
R0 = /= (4)(0.2)/(0.8) = 1
Compartment sizes Flow sizes
SusceptibleInfectedRecovered
Transmissions (incidence)Recoveries
8-13 July 2013
UW - NME 2013 29
Susceptible Infected
SIR model with births and deaths
t = times(t) = number of susceptible people at time ti(t) = number of infected people at time tr(t) = number of recovered people at time t = act rate per unit time = prob. of transmission given S-I actr = recovery ratef = fertility ratems = mortality rate for susceptiblesmi = mortality rate for infectedsmr = mortality rate for recovereds
Recoveredbirth
death death death
trans. recov.
8-13 July 2013
UW - NME 2013 30
Stochastic Pairwise models (SPM)
8-13 July 2013
UW - NME 2013 31
Basic elements of the stochastic model
โข System elementsโ Persons/animals, pathogens, vectors
โข Statesโ properties of elements
As before, but
โข Transitionsโ Movement from one state to another: Probabilistic
8-13 July 2013
UW - NME 2013 32
Deterministic vs. stochastic modelsSimple example: Proportional growth model
โ States: only I is tracked, population has an infinite number of susceptiblesโ Rate parameters: only , the force of infection (๐ฝ b = ta)
Deterministic Stochastic
Incidence(new cases)
Incident infections are determined by the force of
infection
Incident infections are drawn from a probability distribution
that depends on
8-13 July 2013
UW - NME 2013 33
What does this stochastic model mean?
Depends on the model you choose for P(โ)
P(โ) is a probability distribution.โ Probability of what? โฆ that the count of new infections dI = k at time tโ So what kind of distributions are appropriate? โฆ discrete distributionsโ Can you think of one?
Example: Poisson distributionโข Used to model the number of events in a set amount of time or spaceโข Defined by one parameter: it is the both the mean and the varianceโข Range: 0,1,2,โฆ (the non-negative integers)โข The pmf is given by:
๐ (๐๐ผ ๐ก=๐|๐ฝ , ๐ผ๐ก ,๐๐ก ยฟ
P(X=k) =
8-13 July 2013
UW - NME 2013 34
How does the stochastic model capture transmission?
The effect of l on a Poisson distribution
Mean: E(dIt)=lt
Variance: Var(dIt)=lt
If we specify: lt = b It dt
Then: E(dIt)= b It dt , the deterministic model rate
P(dIt=k) =
8-13 July 2013
UW - NME 2013 35
What do you get for this added complexity?
โข Variation โ a distribution of potential outcomesโ What happens if you all run a deterministic model with the same parameters?โ Do you think this is realistic?
โข Recall the poker chip exercises โข Did you all get the same results when you ran the SI model?โข Why not?
โข Easier representation of all heterogeneity, systematic and stochasticโ Act ratesโ Transmission ratesโ Recovery rates, etcโฆ
โข When we get to modeling partnerships: โ Easier representation of repeated acts with the same personโ Networks of partnerships
8-13 July 2013
UW - NME 2013 36
Example: A simple stochastic model programmed in R
โข First weโll look at the graphical output of a model
โข โฆ then weโll take a peek behind the curtain
8-13 July 2013
UW - NME 2013 37
Behind the curtain: a simple R code for this model
# First we set up the components and parameters of the system
steps <- 70 # the number of simulation stepsdt <- 0.01 # step size in time units
total time elapsed is then steps*dt
i <- rep(0,steps) # vector to store the number of infected at time(t)di <- rep(0,steps) # vector to store the number of new infections at
time(t)i[1] <- 1 # initial prevalence
beta <- 5 # beta = alpha (act rate per unit time) * # tau (transmission probability given act)
8-13 July 2013
UW - NME 2013 38
# Now the simulation: we simulate each step through time by drawing the# number of new infections from the Poisson distribution
for(k in 1:(steps-1)){
di[k] <- rpois(n=1, lambda=beta*i[k]*dt)
i[k+1] <- i[k] + di[k]
}
In words:
For t-1 steps (for(k in 1:(steps-1))) Start of instructions ( { )
new infections at step t <- randomly draw from Poisson (rpois) di[k] one observation (n=1) with this mean (lambda= โฆ )
update infections at step t+1 <- infections at (t) + new infections at (t) i[k+1] i[k] ni[k]
End of instructions ( } )
Behind the curtain: a simple R code for this model
lt = b It dt
8-13 July 2013
UW - NME 2013 39
The stochastic-deterministic relationโข Will the stochastic mean equal the deterministic mean?
โ Yes, but only for the linear modelโ The variance of the empirical stochastic mean depends on the number of
replications
โข Can you represent variation in deterministic simulations?โ In a limited way
โข Sensitivity analysis shows how outcomes depend on parametersโข Parameter uncertainty can be incorporated via Bayesian methodsโข Aggregate rates can be drawn from a distribution (in Stella and Excel)
โ But micro-level stochastic variation can not be represented.
โข Will stochastic variation always be the same?โ No, can specify many different distributions with the same mean
โข Poissonโข Negative binomialโข Geometric โฆ
โ The variation depends on the probability distribution specified8-13 July 2013
UW - NME 2013 40
To EpiModelโฆ
8-13 July 2013
UW - NME 2013 41
ห( ) 0i t is required by condition 3, and also satisfies conditions 1 and 2
Without new people entering the population, the epidemic will always die out eventually.
Note that s(t) and r(t) can thus take on different values at equilibrium
alsowritten
as
Appendix:Finding equilibria
Using the SIR model without birth and death
๐ (๐ก+1 )=๐ (๐ก )โ๐ (๐ก )๐ ๐ (๐ก )๐ ๐
๐ (๐ก+1 )=๐ (๐ก )+๐ (๐ก )๐ ๐ (๐ก )๐ ๐โ๐ฃ๐ (๐ก )
๐ (๐ก+1 )=๐ (๐ก )+๐ฃ๐ (๐ก )
๐๐ ๐๐ก=โ๐ (๐ก )๐ ๐ (๐ก )
๐ ๐
๐๐/๐๐ก=๐ (๐ก )๐ ๐ (๐ก )๐ ๐โ๐ฃ๐ (๐ก )
๐๐ /๐๐ก=๐ฃ๐ (๐ก )
0=โ๐ (๐ก )๐ ๐ (๐ก )๐ ๐
0=๐ (๐ก )๐ ๐ (๐ก )๐ ๐โ๐ฃ๐ (๐ก )
0=๐ฃ๐ (๐ก )
๏ฟฝฬ๏ฟฝ (๐ก )=0 ๏ฟฝฬ๏ฟฝ (๐ก )=0or
๏ฟฝฬ๏ฟฝ (๐ก )=๐ฃ๐/๐ ๐ฝ ๏ฟฝฬ๏ฟฝ (๐ก )=0or
๏ฟฝฬ๏ฟฝ (๐ก )=0
8-13 July 2013