modeling frameworks

41
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 UW - NME 2013 1 8-13 July 2013

Upload: ruana

Post on 23-Feb-2016

41 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Modeling  frameworks

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

Page 2: Modeling  frameworks

UW - NME 2013 2

Deterministic Compartmental Modeling

Susceptible Infected Recovered

8-13 July 2013

Page 3: Modeling  frameworks

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

Page 4: Modeling  frameworks

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

Page 5: Modeling  frameworks

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

Page 6: Modeling  frameworks

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

Page 7: Modeling  frameworks

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

Page 8: Modeling  frameworks

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

Page 9: Modeling  frameworks

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

Page 10: Modeling  frameworks

UW - NME 2013

Example: Proportional-growth modeli(1) = 1; r = 0.3

108-13 July 2013

Page 11: Modeling  frameworks

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

Page 12: Modeling  frameworks

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

Page 13: Modeling  frameworks

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

Page 14: Modeling  frameworks

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

Page 15: Modeling  frameworks

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

Page 16: Modeling  frameworks

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

Page 17: Modeling  frameworks

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

Page 18: Modeling  frameworks

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

Page 19: Modeling  frameworks

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

Page 20: Modeling  frameworks

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

Page 21: Modeling  frameworks

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

Page 22: Modeling  frameworks

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

Page 23: Modeling  frameworks

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

Page 24: Modeling  frameworks

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

Page 25: Modeling  frameworks

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

Page 26: Modeling  frameworks

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

Page 27: Modeling  frameworks

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

Page 28: Modeling  frameworks

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

Page 29: Modeling  frameworks

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

Page 30: Modeling  frameworks

UW - NME 2013 30

Stochastic Pairwise models (SPM)

8-13 July 2013

Page 31: Modeling  frameworks

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

Page 32: Modeling  frameworks

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

Page 33: Modeling  frameworks

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

Page 34: Modeling  frameworks

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

Page 35: Modeling  frameworks

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

Page 36: Modeling  frameworks

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

Page 37: Modeling  frameworks

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

Page 38: Modeling  frameworks

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

Page 39: Modeling  frameworks

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

Page 40: Modeling  frameworks

UW - NME 2013 40

To EpiModelโ€ฆ

8-13 July 2013

Page 41: Modeling  frameworks

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