Download presentation
Presentation is loading. Please wait.
Published byShauna Boyd Modified over 8 years ago
2
SS r
3
SS r This model characterizes how S(t) is changing
4
SS r How many people are susceptible at time = t? What is S(t) = ? There are a number of approaches…
5
Discrete / Numerical Analytical Simulation of stochastic events Bonus: scheduling events via a stochastic algorithm
6
S We know that: r Approach #1
7
SS r
8
SS r
9
SS r Discrete (aka “Numerical”) Approach #1
10
SS r Differential equation This one is not that difficult to solve Approach #2
11
SS r Solving for S(t) yields: Analytic Approach #2
12
S S I1I1 In each time step, each individual “leaves” S with probability = r A population of 10 susceptible Individuals at T 0 I 10 I2I2 I3I3 I9I9 I4I4 I8I8 I5I5 I7I7 I6I6 Approach #3
13
In each time step, each individual “leaves” S with probability = r - Generate a random number, U, between 0 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 S I1I1 I 10 I2I2 I3I3 I9I9 I4I4 I8I8 I5I5 I7I7 I6I6 Approach #3
14
In each time step, each individual “leaves” S with probability = r Individual i UiUi 10.871 20.600 30.290 40.335 50.421 60.180 70.033 80.663 90.338 100.246 S S I1I1 I 10 I2I2 I3I3 I9I9 I4I4 I8I8 I5I5 I7I7 I6I6 Approach #3
15
In each time step, each individual “leaves” S with probability = r S S I1I1 I 10 I2I2 I3I3 I9I9 I4I4 I8I8 I5I5 I7I7 I6I6 S S I1I1 I2I2 I3I3 I9I9 I4I4 I8I8 I5I5 I6I6 Approach #3
16
Using indicator variables to denote if an individual is still in “S” S S 1 1 1 1 1 1 1 1 1 1 S S 1 1 1 1 1 1 1 1 0 1 Approach #3
17
Repeat for the desired number of time steps to determine S(t) S S 1 1 1 1 1 1 1 1 0 1 S S ? ? ? ? ? ? ? ? 0 ? Approach #3 Stochastic
18
If events are happening at a constant rate,, we can model the time to the next event using an exponential distribution Recall that the mean of an exponential distribution is 1/ The c.d.f. is: F = P(T < t) = 1 – e – t Solving for t gives: t = -ln(1 – P) / F -1 Lets see a visual….
19
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 – t
20
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) / The result is a exponentially distributed waiting time Repeat
21
F -1 = -ln(1 – P) / Mean = 1/2
22
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)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.