-
Notifications
You must be signed in to change notification settings - Fork 2
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
Package: bed occupancy forecasting #3
Comments
If this is still required I've started packaging it up over at https://github.com/tjtnew/bedoc. A little hectic today but can probably get something reasonable finished by c.o.p tomorrow if it's still required. |
Yes, this is still needed :) I'll remove my totally unrealistic deadline, but this is still very topical and timely. Many thanks for getting started on this! |
A few questions:
|
I've thought some more in regards to the second and third bullets above. I think it would make sense to have |
Sorry about the slow response on this.
That's a mistake, having it's origin in a technicality, from memory: the function was throwing an error if there was a day of zero admissions due to using
I named these poorly. I think ideally this should perhaps be a generic with specific S3 methods for different classes of objects? And to be consistent with projections, maybe we could settle for
Yes (to the last suggestion).
It does. Thank you so much for your help - very appreciated! |
OK, it would make sense, but maybe a middle group, using S3 generic / method, would be to provid a method for
An easy way to go about this would be adding a |
That sounds good. In regards to a vignette is any of the data/projections used in your paper available in the open? I'm guessing not, but it would make a nice example if they were. |
Unfortunately no, no publicly available data for this specific example. But we can try to make a decent example using realistic epi parameters. I paste below code for a length-of-stay distribution publicly available, with some random admissions as ## Data from across 23 countries with “many of the included cases from the
## UK”. 290 patients, of which 163 with recorded outcomes. 52 admitted to
## ICU. Data collected on patients with data collection commenced on or before
## 13 March 2020. Report issued 27 March 2020.
## https://media.tghn.org/medialibrary/2020/03/ISARIC_Data_Platform_COVID-19_Report_27MAR20.zip
## Mean hospital LOS to death or discharge (n=163) 5.3 days (SD 4.25)
## Roughly: median 5 days, QIR: 3-7
los_isaric <- distcrete::distcrete("weibull", shape = 2, scale = 6, w = 0.5, interval = 1)
## make toy admission data
library(incidence)
library(magrittr)
admissions <- sample(Sys.Date() - c(0,7), 40, replace = TRUE) %>%
incidence()
## project bed occupancy for current admissions
## project future admissions
[...]
## project bed occupancy for current + future admissions
[...]
Note that the missing bit, beyond the bed occupancy part, is a serial interval distribution (
I will ask what serial interval is currently used for UK data. |
I've included a few simple integrations tests and we have good coverage save for the sanity checks which we could easily check although perhaps a little unnecessary. CI is set up with GitHub Actions which checks the build on mac (release + devel), windows (release) and linux (release). It also builds the basic pkgdown site and integrates coverage with codecov. Currently these run as separate jobs so this could be streamlined somewhat. From your last comment I take it you want to implement a Can we move future discussion over to https://github.com/tjtnew/bedoc/issues as it will be good to keep the discussion tied to the repo. On a similar note let me know if you want to shift the repo over to Reconhub and for us continue development there. Have a good weekend. |
Impressive! Great, I will take the conversation there. |
Package now at https://github.com/reconhub/occupancy |
Package: bed occupancy forecasting
Description
Package existing code to implement forecasting of daily bed occupancy from input on daily admissions and the distribution of duration of stay.
The package should include documentation, simple reproducible examples, unit tests.
Use cases / specs
Date
integer
distcrete
object (preferably) or as a function returninginteger
numbers along the lines ofrgeom()
projections
objectprojections
objectsRelevant related pacakges
Starting point
A starting point is provided in the two following gists:
Impact
Some of the main questions for COVID19 response relate to hospital bed capacity. For this, multpile modelling groups are making forecastings of bed occupancy, e.g. our app. However there is no consistent way of doing this, leaving room for potential errors and consistency across results. Having a reliable, computer-efficient, well documented and tested way of forecasting bed occupancy will improve the quality of, and the ease for providing, these predictions.
Proposed timeline
Focal point
@thibautjombart
The text was updated successfully, but these errors were encountered: