Epidemiological models for Influenza and COVID-19

fitDataWDR returns a list of 3 data series. Each data series is a list of pairs of values of the form {time, number}. The first data series in the number of confirmed cases (not the cumulative number), the second is the number of recovered cases (which happens to be cumulative because it’s a sink), and the third series is the number of deaths (also cumulative because it’s a sink).

For example the first 5 elements of each series for Beijing is

In[18]:= fitData = 
  fitDataWDR[Entity["AdministrativeDivision", {"Beijing", "China"}], 
   "21 Jan 2020", "dateRange" -> All];

In[19]:= Take[#, 5] & /@ fitData

Out[19]= {{{1., 14}, {2., 22}, {3., 35}, {4., 39}, {5., 66}}, {{1., 
   0}, {2., 0}, {3., 1}, {4., 2}, {5., 2}}, {{1., 0}, {2., 0}, {3., 
   0}, {4., 0}, {5., 0}}}

If you don’t have data for one of those series, then leave it out of the list of series, and also leave the corresponding model out of the list of models given to sumSquaredError.

Hope this helps!

When I ran the code on your last reply I got the following error. Can I work with the data from Argentina?

Error.nb (3.9 KB)

Once again: A very impresive project!
Statistical fit does not work though (see attached notebook). Please advise!

EpidemiologicalModelsForInfluenzaAndCOVID-19–part_1.nb (1.41 MB)

Sorry for the delay in responding.

In your notebook, you have

In[19] := Take[#, 5] & /@ fitData

which looks like a copy & paste error. Remove the “In[19]:=” from the code.

I had updated the package last week, but unfortunately missed two necessary changes needed in the full version notebook.

There is an updated version of that notebook in the Cloud now. It has today’s date for the most recent revision.

Any pointer to that notebook?

These are the notebooks I updated a few hours ago:

Thank you. I am testing them.

This would be a great example of Dynamic.

Many thanks for your contribution. I Excellent work. But what would happen if used with QuantileRegression.m?

Thank you for your suggestion. At the moment, the bigger issue is finding the right structural form for the model, that is, the compartments and their connections, and adequately mapping them to the available data. Once that is done, then perhaps using quantile regression might provide more robust estimates of the parameters for more reliable predictions.

There is also an issue with parameter identifiability, regardless of the estimation method. This will take a certain amount of domain knowledge to properly choose which parameters to hold fixed and which to estimate.

Hi Robert,

I am trying access the covid19 data for Iran by using the following

fitData = 
  fitDataWDR[Entity["Country", {"Iran"}], "1 March 2020", 
   "dateRange" -> All];

but getting following error :

fitDataWDR::locnf: Locale Entity[Country,{Iran}] not found.

Could you please tell me what wrong am I doing here.

Regards

There is a syntax error in the Entity specification. Use

fitData = fitDataWDR[Entity["Country", "Iran"], "1 March 2020", "dateRange" -> All];

Have you considered adding a quarantine? components to the SEIsaRD model?

It seems that would be the next logical model improvement step, especially for Chinese data which had a very aggressive Quarantine implemented. Then add multiple different population cohorts (child, young adult, middle age adult, old adult, compromised health-for all age groups).

Of course that is a lot more work!

Thanks for a really nice post and nice work! I’ve made my own model that includes quarantine but instead of creating a compartment (state variable) for quarantined I simply made beta a time varying function that drops a certain level once quarantine is started. I guess that’s a good enough approximation even though it might not catch all dynamics.

Now my question. Looking at e.g. Hubai outbreak you get beta = 0.79 and gamma = 0.04, which would correspond to an R0 of =19.8 (beta/gamma). But I’ve seen work estimating R0 to between 2 and 2.5 for Corona. Why the discrepancy?

Regards Peter Aronsson

Hi, I have a problem with notebook 1, I already downloaded the package and put it in the same directory

Indeed you do! How did you “download” it?

Using the “Download” button in the Wolfram Cloud, using the “Open from Cloud…” button on the Desktop Mathematica Welcome screen, or using File > Open from Wolfram Cloud… menu work OK.

The only time I’ve seen this behavior is with

NotebookOpen["https://www.wolframcloud.com/obj/rnachbar/Published/\
EpidemiologicalModelsForInfluenzaAndCOVID-19--part_1.nb"]

from the desktop.

Try one of the three methods I first mentioned.

PS. I see that you’re using Mathematica 11.3. Some things may not render correctly when the notebook is first opened (e.g., some cell styles are not defined), but reevaluating inputs should take care of that.

Congratulations! This post was featured in the Wolfram Blog Wolfram Community Takes on Current Events: COVID-19 Data, Green Spaces, Homeschool Puzzles and More. We are looking forward to your future contributions.


wolfram-blog-logo2.png