-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix calculation of new infected cases #190
Conversation
@@ -74,7 +74,7 @@ def admitted_patients_chart( | |||
|
|||
return ( | |||
alt.Chart(census.head(plot_projection_days)) | |||
.transform_fold(fold=["Hospitalized Census", "ICU Census", "Ventilated Census"]) | |||
.transform_fold(fold=["Hospitalized", "ICU", "Ventilated"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to get the graphs' x-axes to line up vertically. Label redundant to plot title and y-label.
There's an approximate invariant you can use to test the admissions values, no matter how they're calculated:
That's saying that everyone who should now be or have been hospitalized at the subject hospital was (counted as) admitted on some particular day. I've very roughly hacked this in to admissions = build_admissions_df(param)
cumulative_admissions = admissions.cumsum()
diff = cumulative_admissions["Hospitalized"][1:-1] - (0.05*0.05 * (param.infected_v[1:-1] + param.recovered_v[1:-1]) - 100)
assert (diff.abs() < 0.1).all() |
Closes #189