Question: a ) Write a function in R to simulate epidemics using the discrete time SIR model in Section 2 . 2 . 2 of the

a) Write a function in R to simulate epidemics using the discrete time SIR model in Section 2.2.2 of the notes.
The transition between compartments are described using the chain binomial model:
I* t Bin(St ,\pi ^(SI))
R*t Bin(It,\pi ^(IR))
The transmission probability is derived from a Poisson contact process and homogeneous mixing:
\pi (SI)=1exp(\beta (It/N))
The removal probability assumes the length of time infectious is exponentially distributed: \pi (IR)=1exp(\gamma ) The function should have inputs which include the population size (N ), initial conditions (S0, I0), model parameters (\beta ,\gamma ), and the last time point at which to simulate new cases and removals (\tau ).
Output should include the numbers of individuals contained in the S, I, R, I and R states over time.
Include the function code in your writeup.
b) Use your epidemic function to simulate an epidemic with initial conditions:
S0=995; I0=5; R0=0(so, population size, N =1000)
and model parameters:
\beta =0.35; \gamma =0.1
for \tau =60 time points.
Produce plots of both the prevalence curve over time (I) and incidence curve over time (I).
c) We are now going to carry out a Monte Carlo simulation in order to estimate some character- istic of the disease system described by this model. Specifically, we are going to look at the probability that a single infection results in a substantial epidemic, which we will define as more than 50 out of 1000 individuals being infected before the epidemic dies out.
We will use the same parameter values and population size, but change the initial conditions to:
S0=999; I0=1; R0=0.
You can either use your epidemic function, or adapt it if necessary, so that you can run multiple epidemics in order to estimate whether more than 50 individuals are infected before the epidemic dies out.
Try to estimate this probability to 2 decimal places,and provide evidence that your answer is correct to this degree of accuracy.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!