Answered step by step
Verified Expert Solution
Question
1 Approved Answer
When we worked with the SIR models, we made the assumption that the population of S , I, and R individuals was always large enough
When we worked with the SIR models, we made the assumption that the population of S I, and R individuals was always large enough to justify a continuoustime, deterministic model. In practice, this is rarely the case at the beginning of an outbreak, when there are very few infected individuals; some diseases will take off, whereas others will fizzle out if the It dont manage to infect anyone before they recover. It this problem, we will approach the SIR model through stochastic simulation. In this model, i The total population size is Ntot, which does not change over the time of the simulation. ii At any given moment there will be S susceptible, I infected, and R Ntot S I recovered individuals, where S I, R are the number rather than the proportions of individuals. iii. The total rate for any transition S I or I R is lambda tot ISRNtot I. Hence, waiting times can be drawn from an Explambda tot distribution. iv Given an event, the probability that one of the infectives recovers is Ilambda tot; otherwise, a susceptible gets infected. v Starting from initial populations It Iinit, St Ntot It Rt we repeat steps iiv until the system hits a fixed point. Given this, a State the criterion for ending the simulation. That is what is the fixed point? b In step iii we asserted that the total rate for any transition is lambda tot ISRNtot I. What is the reasoning for this? c Implement the above using Gillespies algorithm. Your function should take arguments Iinit, Ntot and R It should return an array of four columns: time t for the step, S I, and R Ntot S I. Note: R is the reproduction number for the disease, not Rt; be sure that you dont accidentally conflate them in your code. d Run the stochastic SIR model five or more times with Ntot It R Plot I vs t for each one or all of them on the same axis with different colours What do you observe? e Modify your function from part c to return only Ipeak, the maximum number infected over the course of the whole simulation and tf the duration of the simulation ie time until it hits a fixed point Note that you need not keep thw whole timeseries for this, just Ipeak and tf Then, write another wrapper function that will call that function Nsim times. The output of your wrapper function should be a twocolumn array with Nsim rows, where the first column is Ipeak and the second column is tf for each run. f Using the above function, plot a histogram of tf when Nsim Comment on what you observe; what does it imply for the distribution of outbreak durations?
When we worked with the SIR models, we made the assumption that the population of S I,
and R individuals was always large enough to justify a continuoustime, deterministic model.
In practice, this is rarely the case at the beginning of an outbreak, when there are very few
infected individuals; some diseases will take off, whereas others will fizzle out if the It
dont manage to infect anyone before they recover. It this problem, we will approach the SIR
model through stochastic simulation. In this model,
i The total population size is Ntot, which does not change over the time of the simulation.
ii At any given moment there will be S susceptible, I infected, and R Ntot S I
recovered individuals, where S I, R are the number rather than the proportions of
individuals.
iii. The total rate for any transition S I or I R is lambda tot ISRNtot I. Hence,
waiting times can be drawn from an Explambda tot distribution.
iv Given an event, the probability that one of the infectives recovers is Ilambda tot; otherwise, a
susceptible gets infected.
v Starting from initial populations It Iinit, St Ntot It Rt
we repeat steps iiv until the system hits a fixed point.
Given this,
a State the criterion for ending the simulation. That is what is the fixed point?
b In step iii we asserted that the total rate for any transition is lambda tot ISRNtot I.
What is the reasoning for this?
c Implement the above using Gillespies algorithm. Your function should take arguments
Iinit, Ntot and R It should return an array of four columns: time t for the step, S
I, and R Ntot S I. Note: R is the reproduction number for the disease, not
Rt; be sure that you dont accidentally conflate them in your code.
d Run the stochastic SIR model five or more times with Ntot It R
Plot I vs t for each one or all of them on the same axis with different colours What
do you observe?
e Modify your function from part c to return only Ipeak, the maximum number infected
over the course of the whole simulation and tf the duration of the simulation ie time
until it hits a fixed point Note that you need not keep thw whole timeseries for this,
just Ipeak and tf Then, write another wrapper function that will call that function
Nsim times. The output of your wrapper function should be a twocolumn array with
Nsim rows, where the first column is Ipeak and the second column is tf for each run.
f Using the above function, plot a histogram of tf when Nsim Comment on what you
observe; what does it imply for the distribution of outbreak durations?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started