neherlab / covid19_scenarios

Models of COVID-19 outbreak trajectories and hospital demand
https://covid19-scenarios.org
MIT License
1.36k stars 352 forks source link

user controllable percentages for hospitalization, ICU, and deaths + complete export + fade-in/-out of mitigation #594

Open ccpf opened 4 years ago

ccpf commented 4 years ago

🙋 Feature Request

I have a couple of requests so will list them as bullet points:

  1. I am unable to fit deaths, hospitalizations, and ICU numbers at the same time. I consider hospitalizations and ICU numbers to be the most accurate numbers of the lot, deaths should probably be scaled up by 50% from the official numbers but the model gives numbers that are often factors of 3 to 4 higher than the data (I am looking at Spain) and the only way of keeping them within a factor 2 of the data is by artificially increasing ICU capacity and setting the ICU overflow severity to <1 which is obviously not ideal. So it would be nice to be able to change the percentages that go to hospital, to ICU, and that eventually die.
  2. When I export a graph it would be handy if everything that I see in the figure gets exported in one neat package, i.e., not just model data but also mitigation periods and percentages as well as the real data. This would make it easier to recreate the plot without having to download the different bits and pieces from different locations.
  3. And finally, it would be nice if the mitigation measures would have some fade-in and fade-out ability as they are not usually this clear-cut. E.g., the population will maybe take about 7-10 to fully comprehend the situation and take the measures seriously (from personal experience I can tell that in Spain they may take even longer ;-)). So for instance use some asymptotic function that gradually ramps up the mitigation efficiency from 0 to X over n days. The fade-out is probably more instantaneous as people will be keen to go back to normality.

🔦 Context

In general these features will make it easier to fit the model to data. I also think that they will add some more realism to the simulation. As for the export issue, this is merely for the benefit and convenience of the user but should also help to make your model more popular ;-).

😯 Describe the feature

Feature 1 can be achieved by simply adding 3 input boxes that allow the user to specify the percentages of cases that go to (i) the hospital, (ii) ICU, (iii) the morgue. Feature 2 can be achieved by bundling all the data that is displayed in the figure in the same csv or json file. Feature 3 can be accomplished by having the mitigation periods fade in and allow the user to specify the number of days until the full percentage is reached.

💻 Examples

see above

💁 Possible Solution

Features 1&2 should be obvious. For Feature 3, you could perhaps use a function of the form: p(t)=P0-P0/t^2 to ramp up the percentage p over time t, where P0 is the final effectiveness of the mitigation. By varying the exponent of t in the denominator you can control the speed of how quickly P0 is achieved. So a function like this would be for "quick learners", i.e., societies that trust their government and quickly adhere to new rules (such as Scandinavians) as it has a steep initial rise and then flattens at the end. For societies that distrust the government and are rather sluggish to grasp new rules (like where I live in Spain), you could use a cosine (slow start, faster in the middle, slow in the end): p(t)=P0/2(1-cos(pit/T)) for t € [0 T] where T is the (user controllable) number of days it should take to reach P0.

Related

-

ccpf commented 4 years ago

actually, I just realized that the data plotted alongside the model curves for hospitalizations/ICUs is wrong (see issue #595) and also cannot be fixed as data on current hospitalizations/ICUs is not available for Spain. So this kind of reduces feature request #1 to just provide an input box for being able to adjust mortalities (at least for Spain - for other countries it may still be viable to adjust the other tow as well). I would also suggest to remove the data points in the Spain scenario for ICU and hospitalization altogether as it makes no sense trying to fit the model to those as they are mostly cumulative numbers. Instead, scaling up the official number of deaths by about 50% to account for the dark figure and then fitting the model to those corrected death data would seem like the best approach.

ccpf commented 4 years ago

actually, could I perhaps reduce feature request #1 from above to just:

I would think this to be an urgent fix as there are way too many deaths being predicted. I am using the model on the Spain data and even if I assume "real" deaths to be 85% higher than "official" deaths (see here for instance: https://elpais.com/espana/madrid/2020-04-22/madrid-reconoce-11852-muertes-vinculadas-al-coronavirus-4275-mas-de-las-que-comunica-al-gobierno.html), the deaths are still growing far to quickly if I try to fit the early part of the curve. The only way I could produce a reasonable fit (see below) was by artificially suppressing the deaths by giving an ICU overflow "bonus", i.e., setting the penalization to <1. In fact I had to use 0.06. By adjusting the ICU bed capacity I could adjust when the deaths should start to grow more slowly (I used about 35000 in the figure below). Clearly this is not ideal, as I would like to be able to compare the mitigation scenario with the unmitigated one and I am not sure how to do this if I have to tweak these parameters like this. So if I could use a lower mortality to start with, I would be able to fit the model to the deaths while still being able to penalize ICU overflow with something >1 which would give a more realistic unmitigated scenario.

image

Here the same figure but using a realistic ICU capacity of about 6500 and and ICU overflow penalization of 2. The model exceeds even these 85% upward corrected deaths by a factor of 2.7 as of today.

image

ivan-aksamentov commented 4 years ago

The data issue should be resolved now, see #595 .

I will keep this open because of feature request.