A tool for estimating Length of Stay (LoS) distributions in healthcare settings using deconvolution techniques.
The LoS Estimator derives patient length of stay distributions from ICU admission and occupancy time series data. It employs statistical fitting techniques to identify the underlying probability distribution that best explains observed occupancy patterns, enabling data-driven resource planning and capacity management.
Note
This work builds on the methodology described in:
- Schuppert, S. Theisen, P. Fränkel, S. Weber-Carstens, C. Karagiannidis.
Bundesweites Belastungsmodell für Intensivstationen durch COVID-19. (English: Nationwide exposure model for COVID-19 intensive care unit admission)
- Multiple Distribution Support: Fit lognormal, gamma, Gaussian, exponential, and compartmental models
- Rolling Window Analysis: Track temporal changes in LoS distributions over time
- Automated Model Selection: Compare distributions and identify the best-fitting model
- Rich Visualizations: Generate plots and animations of fitting results
- Flexible Configuration: TOML-based configuration with command-line overrides
- Real-World Data Ready: Includes preprocessing tools for RKI COVID-19 ICU data
The estimator is built on the following principles:
- Convolution Model
We assume that individual patient length of stay (LoS) follows a probability distribution (e.g., lognormal, gamma). By convolving the admission time series with discharge probabilities derived from the LoS distribution, we can model expected occupancy over time:
\text{Occupancy}(t) = \sum_{\tau=0}^{t} \text{Admissions}(t-\tau) \cdot P(\text{LoS} > \tau)- Deconvolution Problem
- Given observed admissions and occupancy, estimating the LoS distribution can be described as the inverse problem of fitting distribution parameters to minimize prediction error.
- Temporal Dynamics
- LoS distributions may shift due to treatment protocol changes, patient demographics, or disease characteristics. The estimator uses a rolling window approach to track these changes, fitting distributions on overlapping time windows.
The animation below illustrates the rolling window training process:
Figure: Evolution of fitted LoS distributions across time windows
Installation
git clone git@git.rwth-aachen.de:jrc-combine/los-estimator.git
cd los-estimator
python -m venv .venv
# On Windows
.\.venv\Scripts\activate
# On Linux/macOS
source .venv/bin/activate
pip install -r requirements.txtRun Synthetic Example
python examples/synthetic_example.pyRun with Real Data
python -m los_estimator --config_file los_estimator/default_config.tomlFull documentation is available at: https://los-estimator.readthedocs.io/
los-estimator/ ├── los_estimator/ # Main package │ ├── cli/ # Command-line interface │ ├── config/ # Configuration management │ ├── core/ # Core data structures │ ├── data/ # Data loading and preprocessing │ ├── evaluation/ # Model evaluation │ ├── fitting/ # Distribution fitting algorithms │ └── visualization/ # Plotting and animation ├── examples/ # Example scripts and data ├── docs/ # Sphinx documentation ├── tests/ # Unit and integration tests └── results/ # Output directory (created at runtime)
For questions, issues, or contributions:
- Issues: GitLab Issue Tracker
- Author: Younes Müller
- Institution: RWTH Aachen University
Documentation: https://los-estimator.readthedocs.io/
Source: https://github.com/Younesmueller/los-estimator
Issue tracker: https://github.com/Younesmueller/los-estimator/issues
