Estimation Run

This example demonstrates how to use the LoS Estimator with real-world data. We will use a sample dataset containing ICU admissions and occupancy data.

A prepared script is provided in run_analysis.py that performs the estimation using the provided data.

Data Preparation

Using Preprocessed Data

The package includes preprocessed ICU data from Germany ready for analysis. The default_config.toml is already configured to use these files—no additional setup is required.

Updating with Fresh Data (Optional)

To use the latest data from the Robert Koch Institute (RKI):

  1. Download the data:

    The RKI maintains COVID-19 ICU data at the Intensivregister repository.

  2. Place the CSV file:

    Save the downloaded file to los_estimator/data/preprocessing/inputs

  3. Run the preprocessing script:

    python los_estimator/data/preprocessing/__init__.py
    

    This generates the required csv file.

  4. Verify configuration:

    Ensure default_config.toml points to the newly generated files.

Running the Analysis

Using the Analysis Script

Run the provided convenience script:

python run_analysis.py

Note: By default, less_windows is disabled in the script, allowing analysis of all windows. To perform a quick test with fewer windows, edit the script and set less_windows = True.

Using the Command Line

Alternatively, use the CLI directly:

python -m los_estimator --config_file los_estimator/default_config.toml

For full CLI documentation, see Command-Line Interface.

Understanding the Results

The analysis generates comprehensive output in the results/ directory. Each run creates a timestamped folder containing:

  • Performance metrics and comparison tables

  • Visualizations of fitted distributions and errors

  • Animations showing model evolution over time

  • Serialized data for post-processing

For a complete description of all output artifacts, see Output Format.

Reloading and Re-Visualization

Results can be reloaded without re-running the entire analysis:

from los_estimator.estimation_run import LosEstimationRun

# Load previous results
run = LosEstimationRun.load_run("results/<run_folder>")

# Generate new visualizations with updated settings
run.visualize_results()
run.animate_results()

This is useful for:

  • Adjusting figure sizes, colors, or styles

  • Creating publication-quality plots

  • Experimenting with different visualization layouts

  • Generating animations with different frame rates

Simply modify the visualization_config or animation_config in your configuration file before reloading.

Next Steps