Skip to content
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

Make census counts inclusive over the relevant lengths of stay #386

Closed
wants to merge 4 commits into from

Conversation

PhilMiller
Copy link
Collaborator

@PhilMiller PhilMiller commented Mar 30, 2020

Fixes: #385

@PhilMiller
Copy link
Collaborator Author

PhilMiller commented Mar 30, 2020

This removes the abstraction of the enumerated dispositions in the census calculation, instead baking in the specific categories. That may be undesirable.

This also changes the model fits, and hence the 'right' values in the tests. I've not checked them, nor am I particularly qualified to actually update them. Perhaps the primary tests should be written in terms of the time and height of the forecast peaks, so that there's at least some consistency over time, and we have a clear understanding of what it means when we change a value in the test suite.

@misken
Copy link

misken commented Mar 30, 2020

In the computation of census_icu should it be using icu_admissions_exclusive instead of admits_df.icu? Seems like icu_admissions_exclusive is being calculated but never used.

@PhilMiller
Copy link
Collaborator Author

Yes, yes it should.

@PhilMiller
Copy link
Collaborator Author

That makes the test failure numbers much closer than they were before, which is heartening.

@misken
Copy link

misken commented Apr 2, 2020

@PhilMiller Finally had time to start to look at this. Noticed that last line in admits_df not getting filled in this branch. There's an off by 1 difference between develop and this branch in build_admits_df :

admits_df = dispositions_df.iloc[:-1, :] - dispositions_df.shift(1) # in this branch
admits_df = dispositions_df.iloc[:, :] - dispositions_df.shift(1) # In develop

Unfortunately, tests still fail. I'll try to look more closely tomorrow.

@misken
Copy link

misken commented Apr 2, 2020

@PhilMiller I think there are two issues. 1) The off by 1 error I mentioned in previous comment is what is causing the admits to not match. I'm running tests on individual data Series equality to find this. When using admits_df = dispositions_df.iloc[:, :] - dispositions_df.shift(1), then the admits match but then equality of census fails. New approach gives higher census - but, I think new approach is right. So, ...

  1. After going through your new census calculation, I think it's correct and that the original census projections are biased low. The reason it's happening, is that, in the current approach, all hospitalizations are getting the ALOS of the hospital. But, a subset of those patients are in the ICU and a subset of those are on vents - both of those subpops having different ALOS values than the overall hospital ALOS.

@PhilMiller
Copy link
Collaborator Author

Thanks for the catch on the off-by-one error. I'll patch that up later today.

As for the substantive forecast accuracy, we need more input from the hospital people with access to real data, and maybe from UX folks on guiding users to give inputs that will generate output they'll interpret correctly.

@misken
Copy link

misken commented Apr 2, 2020

Agree. If user interprets the input ALOS's correctly, it's all good. One thought I had to help users, and I'm working on this right now, is to compute the implied volumes and ALOS's for the subpops of (1) hospital admits who never used ICU and (2) ICU patients who never used vents. Simple computations and just provides user more feedback on the implications of the rate and ALOS values they entered which might help them better calibrate their inputs.

@BrianThomasRoss BrianThomasRoss added the models Correct/improve the underlying models label Apr 21, 2020
@BrianThomasRoss BrianThomasRoss deleted the 385-inclusive-census branch May 12, 2020 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models Correct/improve the underlying models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

["model"] Census for hospital and icu are not inclusive of longer LOS for (respectively) icu and ventilator
4 participants