Gas station without pumps

2020 June 14

New plot for COVID-19

Filed under: Uncategorized — gasstationwithoutpumps @ 22:29
Tags: , , ,

It has been a while since the post I did on exponential and logistic growth models not working.  I’ve continued to scrape data from websites and plot the curves with gnuplot, but they have been very uninteresting—I was seeing almost linear growth in both US and CA curves, both for confirmed cases and for deaths.

I was getting a little bored with the manual data entry, and I did not have a good set of California data, because I had been too lazy to enter it daily.  So today I decided to waste a little time cloning the JHU github repository of data, and write a Python program to extract data from it.  This turned out to be messier than I thought, as JHU has changed the format of the files and data a couple of times,

I started by parsing the US-only files, because they seemed to be pretty clean and uniform, but they only go back 63 days (since 2020 April 12), so miss the early days of the pandemic.  I then started parsing the world-wide data files, which have a lot more rows (more than one per county for California) but fewer columns.  I needed to write routines that would merge data from multiple rows if I wanted state-wide numbers, and the format changed at least once, so that I had to recognize “San Diego County, CA” in “Province/State” as being the same state as “California” in “Province_State”.

It has also been a while since I’ve used matplotlib, so it took me some time to figure out how to do such simple things as requesting that logarithmic axes use plain numbers rather than 10^2 and 10^3.

Anyway, I think I’ve finally gotten the files parsed and been able to extract and plot some data.  I chose for my first plot just to plot the new cases/day vs total cases for each state, which I could not do with gnuplot (because it doesn’t provide an easy way to take the differences between adjacent days nor to do rolling-window averages.

I highlighted two states here: California, because that is the one I live in, and New York, because it has been hit the hardest with COVID-19.

New York has clearly peaked and has a declining new-case rate, while California is still slowly growing. I don’t think that the numbers, even with the per-capita scaling, are really comparable between California and New York, because the California fraction of tests that are positive has remained relatively small, and the new-case rate has tracked with the number of tests fairly well. I think that a lot of the growth in California has been due to increased testing and confirming a larger fraction of the cases, rather than an increase in the actual rate of new infections. (The hospitalization reports plotted by the LA Times indicate a slow decrease in California hospitalizations lately.)

3 Comments »

  1. Thank you for doing the research and sharing it! I’ve been wanting to create mathematical models of COVID but have been too lazy to do so. Awesome.
    https://mathsux.org/

    Comment by Math Sux — 2020 June 18 @ 19:13 | Reply

    • I’ve only done the simplest of math-student-style models, which assume constant conditions—they are not at all applicable to the feedback loop in which people’s behaviors are modified depending on knowledge of the rate of infections. The professional epidemiology modelers try to account for those phenomena, but have widely varying estimates of what factors matter and how much, so come up with a wide range of forecasts.

      Comment by gasstationwithoutpumps — 2020 June 18 @ 19:45 | Reply

  2. […] previous COVID plot showed New York having reached its peak and California doing really well, but things have changed a […]

    Pingback by Updated plot for COVID-19 | Gas station without pumps — 2020 July 16 @ 19:36 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: