Low n_days (e.g. 30) s too low for fitting current_hospitalized against the curve.
Additional details
Instead of running n_days + i_day (because i_day is unknown), prefit simulation only runs for n_days. In many cases this value can be too low for the rising curve to actually reach the current_hospitalized value. When this happens, the fit estimating i_day is bad.
Postfit runs i_day + n_days, but this is no good when i_day has been fitted incorrectly.
Suggested fix
As a quick fix, run prefit an additional 300 days.
A better fix is to run both prefit and postfit simulations until infected drops below 0.5. Turn n_days into a parameter that only effects the UI window, not the simulation.
Summary
Low n_days (e.g. 30) s too low for fitting current_hospitalized against the curve.
Additional details
Instead of running n_days + i_day (because i_day is unknown), prefit simulation only runs for n_days. In many cases this value can be too low for the rising curve to actually reach the current_hospitalized value. When this happens, the fit estimating i_day is bad.
Postfit runs i_day + n_days, but this is no good when i_day has been fitted incorrectly.
Suggested fix
As a quick fix, run prefit an additional 300 days.
A better fix is to run both prefit and postfit simulations until infected drops below 0.5. Turn n_days into a parameter that only effects the UI window, not the simulation.