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

Chime model & curve behavior #443

Open
luistelmocosta opened this issue Apr 2, 2020 · 8 comments
Open

Chime model & curve behavior #443

luistelmocosta opened this issue Apr 2, 2020 · 8 comments
Labels
models Correct/improve the underlying models question Further information is requested

Comments

@luistelmocosta
Copy link

luistelmocosta commented Apr 2, 2020

Hello, I am working directly with a hospital from Porto, Portugal. I have been using this amazing tool to simulate the number of UCI which is very important for us. However, I am having some trouble trying to understand a few things.

  • First this social interaction reduction. Here, we have to reduce this for almost fifteen days. If I use the current day, it will assume that these changes start now, which is not what's happening. What is the best approach here? Use a different starting day, i.e, the day where the measures kicked in and see how the curve behaves until the current day and afterward?
  • The second question is how the curve behaves after that. I can see it goes down for the length of hospital stay that you define and then it goes up indefinitely. Is this the right behavior? It is not easy to explain this phenomenon to someone that will actually use this tool. I would think that it followed a logistic curve and reach the plateau phase in the future or something like that.
  • Third, is it possible to use a model implemented by me and then use the tool to calculate the ICU and Ventilation based on my infected case fit?

Congratulations on this amazing tool and for your effort to serve the community in these hard times. I believe you are making an impact and that's a wonderful thing to see. I hope I can keep using it and improve our methodology 😃

My curve:
imagem

@luistelmocosta luistelmocosta changed the title Chime model & curve behaviour Chime model & curve behavior Apr 2, 2020
@PhilMiller
Copy link
Collaborator

A fix for the social interaction date differing from the forecast date is pending: #418 As a temporary work-around until that's deployed, you could input current hospitalizations as of the mitigation date, and confirm that the rest of your data tracks

@luistelmocosta
Copy link
Author

You mean change the Current Date to the mitigation date and put the number of hospitalizations at that time?

@PhilMiller
Copy link
Collaborator

Yes, exactly. When doing that, please check the curve's fit against the rest of your data, perhaps adjust parameters accordingly, and report what you find.

@PhilMiller PhilMiller added the question Further information is requested label Apr 2, 2020
@PhilMiller
Copy link
Collaborator

For the curve behavior:

Keep in mind that hospital census is a sum over admissions over the preceding length-of-stay days. So, if the mitigation is expected to reduce admissions in the short term, then it can temporarily reduce census if the fall is sharp enough.

Have a look at the bottom graph of Susceptible/Infected/Recovered to see the underlying curves of the model dynamics. Admissions is a fraction of the derivative of Susceptible (essentially), and then Census is a sum over a rolling window of Admissions.

@PhilMiller
Copy link
Collaborator

For substituting your own model, all the relevant code is in src/penn_chime/models.py.

It can definitely be factored better to make this easier, but the entire codebase has been developed under extreme time pressure. I'm helping refactor things to ease that, and would be happy to support others' efforts to do the same

@PhilMiller
Copy link
Collaborator

This part of the documentation will guide you on running your modified version locally:
https://code-for-philly.gitbook.io/chime/open-source/making-your-own-chime-app

@luistelmocosta
Copy link
Author

luistelmocosta commented Apr 2, 2020

Thank you for all your replies!

For the curve behavior:

Keep in mind that hospital census is a sum over admissions over the preceding length-of-stay days. So, if the mitigation is expected to reduce admissions in the short term, then it can temporarily reduce census if the fall is sharp enough.

I know that but why does it go up again after the length of stay days? Shouldn't it follow more a logistic curve and reach the plateau phase? I don't think it is very clear for someone that would use this and it would be hard to explain to them why the curve goes up after a while.
But it seems that doing what you suggested, going back to the mitigation day and run from there makes the curve behave differently

imagem

About the model, I did all of that. Just figuring out what would be the quickest approach. I will try to fit (no pun intended) my logistic model in here and then I could help and share my implementation.

Thanks for your help!

@PhilMiller
Copy link
Collaborator

Just to make sure we're understanding each other:

  • The curves tracking the Susceptible and Recovered populations are expected to approximate logistic functions
  • Admissions tracks the number of people expected to present at the subject hospital each day, as a fraction of the people who transitioned from Susceptible to Infected that day
  • Census tracks the number of people expected to be in care at the subject hospital each day, based on the accumulation of recent admissions and release of discharges and deaths
  • It sounds like you're expecting Census to follow a logistic curve, but it shouldn't - you don't expect to have a monotonically increasing population currently resident in the hospital, eventually approaching some fixed fraction of the total population.
  • A graph of people who have ever been hospitalized would track a logistic function - the hospitalization_rate * (Infected + Recovered). In fact, the code internally tests this as a consistency condition on the rest of the calculation. It's not displayed because no one has seen a reason to ask for it as yet. I don't see what it would add to the forecasting capability, but I'm not an end user nor one of the developers trained in medicine or epidemiology. If it would be useful, it's almost trivial to add.

The reason the census curve starts increasing again length-of-stay days after the drop is because that's when it starts replacing the local minimum values of admissions from right after the drop with successively higher values along the slowed but still increasing admissions curve. The local maximum of the census curve there, if there is one, appears when the summed values on either side of the pre-mitigation admissions peak are at their maximum.

This is all so stark because the model currently doesn't smooth or spread out any of the dynamics at all. Every single person infected on a given day is potentially hospitalized on exactly that day, and their contribution to the census lasts for exactly length-of-stay days.

@BrianThomasRoss BrianThomasRoss added the models Correct/improve the underlying models label Apr 22, 2020
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 question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants