The Most Important Diagram
-
Upload
clarke-stephenson -
Category
Documents
-
view
24 -
download
1
description
Transcript of The Most Important Diagram
The Most Important Diagram
The Most Simple Model(?)
)(rdtSdS
SSr
The Most Simple Model(?)
)(trSdt
dS
SSr
This model characterizes how S(t) is changing
The Most Simple Model(?)
)(trSdt
dS
SSr
How many people are susceptible at time = t?What is S(t) = ? There are a number of approaches…
Approaches
Discrete / Numerical
Analytical
Simulation of stochastic events
Bonus: scheduling events via a stochastic algorithm
The Most Simple Model(?)
S
)(~ trSt
S
dt
dS
)()( tSttSS We know that:
r
Approach #1
The Most Simple Model(?)
S
)()()(
trSt
tSttS
Sr
Approach #1
The Most Simple Model(?)
SSr
ttrStSttS )()()(
Approach #1
The Most Simple Model(?)
SSr
ttrStSttS )()()(
Discrete(aka “Numerical”)
Approach #1
The Most Simple Model(?)
)(trSdt
dS
SSr
Differential equation
This one is not that difficult to solve
Approach #2
The Most Simple Model(?)
)(trSdt
dS
SSr
rteStS 0)(Solving for S(t)yields:
Analytic
Approach #2
The Most Simple Model(?)
S
SI1
0T
In each time step, each individual “leaves” S with probability = r
A population of 10 susceptibleIndividuals at T0
I10
I2 I3
I9
I4
I8
I5
I7I6
Approach #3
The Most Simple Model(?)
0T
In each time step, each individual “leaves” S with probability = r
- Generate a random number, U, between0 and 1 for each individual
- If U > r, individual stays in S
- If U < r, individual leaves S
- Suppose r = 0.05
U ~ Uniform on the interval [0, 1]
S
SI1
I10
I2 I3
I9
I4
I8
I5
I7I6
Approach #3
The Most Simple Model(?)
0T
In each time step, each individual “leaves” S with probability = r
Individuali
Ui
1 0.871
2 0.600
3 0.290
4 0.335
5 0.421
6 0.180
7 0.033
8 0.663
9 0.338
10 0.246
S
SI1
I10
I2 I3
I9
I4
I8
I5
I7I6
Approach #3
The Most Simple Model(?)
0T
In each time step, each individual “leaves” S with probability = r
S
SI1
I10
I2 I3
I9
I4
I8
I5
I7I6
S
SI1
I10
I2 I3
I9
I4
I8
I5
I6
1T
Approach #3
The Most Simple Model(?)
0T
Using indicator variables to denote if an individual is still in “S”
S
S1
1
1 1
1
1
1
1
1 1
1T
S
S1
1
1 1
1
1
1
1
0 1
Approach #3
The Most Simple Model(?)
1T
Repeat for the desired number of time steps to determine S(t)
S
S1
1
1 1
1
1
1
1
0 1
tT
S
S?
?
? ?
?
?
?
?
0 ?
Approach #3
Stochastic
A Stochastic Algorithm
If events are happening at a constant rate, l, we can model the time to the next event using an exponential distribution
Recall that the mean of an exponential distribution is 1/l
The c.d.f. is: F = P(T < t) = 1 – e –lt
Solving for t gives: t = -ln(1 – P) / = l F-1
Lets see a visual….
Suppose l = 2
We can see, for example, that the probability that we’ll wait more than one unit of time is about 0.2. The probability that we’ll have to wait less than one unit is about 0.8.
P(T < t) = 1 – e –lt
Suppose l = 2
We can generate a exponentially distributed r. v.’s using the following algorithm: Generate a uniform r.v. (U) using a
random number generator (e.g. in R) Plug in U in for P in F-1 (U) = -ln(1 – U) / l The result is a exponentially distributed
waiting time Repeat
Suppose l = 2
F-1 = -ln(1 – P) / l
Mean = 1/2
Multiple events
More than one type of event can occur in most models (e.g. birth, death, infection, recovery)
We can add up the rates of each of these to find out the overall rate that events occur
Use our algorithm to determine the time to the next event (stochastically!)
Randomly select which event occurred (proportional to it’s rate)