Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use python Model 1 : An exponential growth model for an epidemic The simplest reasonable model for the early stages of the growth of an

use python
Model 1: An exponential growth model for an epidemic
The simplest reasonable model for the early stages of the growth of an epidemic is one where the rate of change of the number of individuals with the
disease is proportional to the number of people who already have the disease. We can see this assumes that the people with the disease are mixed in
amongst the people without the disease, such that the number of people a sick person meets is a constant. It also assumes that people do not recover
from the disease, at least over the time period of interest. This is characteristic of the earliest phases of the spread of a disease, when there are no controls
put in place to restrict the motion of people, there are many more people who are healthy compared with those who are sick, and the sick haven't yet
recovered.
The model can be written as a differential equation:
dPdt=rP
where P is the number of people with the disease at time t, and r is a measure of how many healthy people each sick person infects. The solution to this
model is
P(t)=Aexp(rt)
where A is the number of infected people at time t=0.
Model 2: A sub-exponential growth model for an epidemic
There are numerous more sophisticated models for epidemic growth. We shall consider the following modification of the previous exponential growth
model:
dPdt=rPq
where P(t)=(rmt+A)mm=11-qA=(P(0))(1m)0 gives a measure of how the growth rate of new cases depends on the number of infected people. The solution to this model is
P(t)=(rmt+A)m
where m=11-q and now A=(P(0))(1m).
In this lab we will compare model 1 and model 2 with early covid data.
Below the lab on Canvas you will find a file COVID19_allcases.txt. This file contains the total number of recorded cases up to that day in the early phase of the pandemic. The first record corresponds to January 22nd, the second to January 23rd, etc.
Read the data into a numpy array. You do not need to use pandas to do this. One approach is to set up a list, open the file, read each line in the file and append the result to the list. Once the list is complete you can convert it to a numpy array.
a) Plot the data
Using matplotlib, plot the data versus time. Can we identify by eye any phases in the disease spread?
There appears to be a period of rapid growth (concave up), followed by a steadily slowing growth (concave down). There is also a significant jump in the number of cases, which when looking at the data collection, is due to a change in the way cases have been recorded.
b) Looking only at the first five data points (let's call this data day 1 to day 5), find a value of r which fits the exponential model to this data. Plot the data and the exponential model together over the first 10 days. What can we conclude about the exponential model?
Type Markdown and LaTeX: 2
c) Now, using your exponential model, extrapolate backwards in time to find the predicted day when 'patient zero' appeared (i.e. when the number of
infected people first goes below one). The disease is thought to have appeared on December 1st 2019. Identify a plausible reason for a discrepancy
between your model and this date.
Type Markdown and LaTeX: 2
d) Fixing r=2 for Model 2, determine a value for q by comparing the first 14 days of data with the model. Plot the data and model out to day 20. Can we
conclude anything about the spread of the disease in light of the model dynamics?
Type Markdown and LaTeX: 2
e)create a png plot showing the data, and models 1 and 2, out to day 31(the end of the data). Constrain the y axis to a maximum value of P=200000.Include a legend in your graph and label your axes.
COVID19_allcases.txt:
580
845
1317
2015
2800
4581
6058
7813
9823
11950
14553
17391
20630
24545
2826
31439
34876
37552
40553
43099
45134
59287
64438
67100
69197
71329
73332
75184
75700
76577
77673
78651
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago