CodeForPhilly / chime

COVID-19 Hospital Impact Model for Epidemics
https://codeforphilly.github.io/chime/
MIT License
205 stars 151 forks source link

["model"] Fitting to current census with a long projection can match to the down-slope #378

Closed PhilMiller closed 4 years ago

PhilMiller commented 4 years ago

Summary

Post #255 / #273 the model gets fit to the current hospitalized census. With a long forecast, the closest fitting day may be past the peak, when we actually want to fit to the closest pre-peak day.

Additional details

Suggested fix

Look for the peak in the range of predictions, and then compute minimum loss day among days up to that day.

PhilMiller commented 4 years ago

Playing with things a bit more, the prescribed-doubling-time mode is much more sensitive to this than the prescribed-first-hospitalization mode, because their fitting procedures differ.

cjbayesian commented 4 years ago

Very good catch, @PhilMiller. Indeed this is an issue with fitting days_since. It's finding the optimal solution on the other side of the curve, which makes perfect sense. Any way to keep it on the left side of the projection will fix this.

cjbayesian commented 4 years ago

If we create a row tracking DI/Dt then we can limit the search space to where this is > 0. As in, the slope of the infections curve has to be positive (eg on the left side of the hump).

cjbayesian commented 4 years ago

DI/Dt is precisely the admissions (scaled), so could just make use of that for the constraint.

PhilMiller commented 4 years ago

@cjbayesian I just noticed in your comments as I'm revisiting this - admissions is a rate coefficient times -dS/dt, not dI/dt - the latter term includes recoveries. This is exactly what you fixed in #189, a week prior.