[NB] Visualizing the Epidemic Data COVID-19

MODERATOR NOTE: coronavirus resources & updates: https://wolfr.am/coronavirus


There are many much more sophisticated models out there using the COVID-19 data but i wanted a simple overview of the data to monitor the progression of the countries and do some comparisons.
.
Therefore i made a simple plot interface of the Infected and deaths of the countries which can be plotted linear and logarithmic. i chose to align all the data to day 0 which is defined as the first day of >100 confirmed infected cases in a country. This makes comparison of countries in their early stage to more affected countries more intuitive.

To fill my own curiosity i have added sigmoidal fits to data to see the “prediction”, which only becomes reliable once a tipping point in controlling the disease is reached. I also calculate the mortality of the confirmed cases. I have chosen to only include the first 20 most affected countries but changing the included countries is easy. The interface allows to turn on and off countries to make comparisons.

Hope its also useful to others.

sigmoid corona.nb (34.3 KB)

10 Likes

news-congrads-kkluyshnik-02-04-19.jpg – you have earned Featured Contributor Badge 2015-11-02_10-07-11.png

Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you, keep it coming, and consider contributing to the The Notebook Archive!

1 Like

Very interesting post, thanks! I am collecting notebooks like yours here:

https://github.com/WolframResearch/COVID-19

May I put a copy of your notebook there?

2 Likes

yes of course, please feel free to use it any way you like

Nice one there as usual

For beginners to Mma:
In[1]:= data = {{5, 99}, {6, 164}, {9, 423}, {10, 647}}

Out[1]= {{5, 99}, {6, 164}, {9, 423}, {10, 647}}

In[2]:= FindFit[data, k E^(a t), {k, a}, t]

Out[2]= {k → 16.3433, a → 0.366346}

In[3]:= f[t_] := 17.395 E^(0.3597 t)

In[43]:= Plot[f[x], {x, 1, 22}]

covidCurveForMmaBeginners.nb (265 KB)

Modified Notebook

Deaths/day

With wide variation in testing, I prefer to look at Deaths rather than Cases. While this gives a useful insight into PEAKING (i.e. max number deaths per day) , I have now added a Deaths/day tab.

Look, for example, at Italy and Spain where there is hope that a peak is near, but at almost 1000 deaths/day.

Country and time offset

There is a table of country and time100 offset, sorted by either variable

Misc. parameters

I have also added a few parameters e,g nc=30 (no of countries) and model=False (to hide the dotted modelling).

sigmoidCorona8.nb (62.1 KB)

I updated my code a bit to now be fully incorporated in Manipulate.

There are three coises to make before running the code.

input.PNG

alignment of lines can be done on infected or deaths or normal time since 20-1

looks a bit different now and also includes the “predicted” tipping point.

sigmoid corona new.nb (295 KB)

Thanks Martijn for you latest version. Apologies for repeating some of my last post

Here is may latest crude development of your original notebook (now called PSACorona1.nb, to avoid confusion with yours) . Can tempt you …,

actual Deaths I still feel actual Deaths is crucial for this, I seldom look at cases, with such wide variation in testing. That being said, Death stats are also far for consistent. Only today, the UK said their death stats would change to finally include deaths outside hospitals

deaths/day: I know then data is noisy (I thought of smoothing) but feel deaths/day is crucial to identify how near “peaking” one is e.g.Italy and Spain in the last week..?

offset time please look at mine with doOffset=False. I am often more than happy to compare growth or not, using “actual time since outbreak” so highlighting the time shifts

I look forward to your views

psaCorona1.nb (65.6 KB)

I ran the code, changed countries, but have the following errors. Some updates are required?

General::stop: Further output of First::nofirst will be suppressed during this calculation.
NonlinearModelFit::srect: Value 3 Max[1400922,Missing[NotAvailable]] in search specification {a,3 Max[1400922,Missing[NotAvailable]]} is not a number or array of numbers. (3 lines)
General::stop: Further output of NonlinearModelFit::srect will be suppressed during this calculation.

Results show red and can you help fixing it? Thanks.