This repository contains all files necessary to reproduce the results in the paper Minimax Optimal Estimation of Stability Under Distribution Shift, the arXiv version is available at this link.
-
Simulation Stability.ipynb
All the code to generate results for the simulation setting: Figures 2 and 3. -
Stability_Statistical_Model_NHIS.ipynb
All the code to generate results for the Health utilization prediction model (NHIS) in Section 5.2 and the appendix. -
stability_queue_code/
All the code to generate results for queueing systems in Section 5.1 and the appendix.model_train_3920_2022-01-28_04/01/39.pkl
#the DQN model trained using the filetrain_DQN.py
, which is also the DQN model in the paperStability_queue_convergence.py
# generate data for Figure 5Stability_queue_functions.py
# all functions necessary for queueing systemsStability_queue_kde.py
# generate data for Figure 5 (the KDE estimator)Stability_queue.ipynb
# code to generate plots for queueing systemstrain_DQN.py
# the script to train the DQN modelmodel_train_3920_2022-01-28_04/01/39.pkl
-
Simulation
Data is generated in the notebook.
-
NHIS
Data is available upon request.
-
Queueing models
To run the queueing systems code for Figure 4 and Figures 7 - 11, one needs to generate data using the scripts given in
Stability_queue.ipynb
. For example, in the below code block, the first line of code generates data and saved it to a file, the second line read the saved data and perform plotting Note that each file will contain a time of generation for versioning purposes: one should modify the time appropriately when reading the file. In the below example, one should change_2023-08-14_12:59:34
appropriately.evaluate_policy_under_distribution(arrival_distribution_t1, service_distribution_t1, mixture_prob_arrival, mixture_prob_service,'distribution_shift_type_1_new',number_of_simulations = 10000) data_0 = joblib.load('./Result/model_data/distribution_shift_type_1_10K_data__2023-08-14_12:59:34.pkl') evaluate_policy_under_distribution(arrival_distribution_t1, service_distribution_t1, mixture_prob_arrival, mixture_prob_service,'distribution_shift_type_1_new',1,data_0)
To replicate the environment for all code, you can install the required packages using the command below. Note that not all packages are necessary. As most packages used in this project are standard, we recommend manually installing any missing packages if issues arise when running the below command.
conda create -n stability_env python=3.10.12
conda activate stability_env
pip install -r requirements.txt
- All file paths in the code needs to be changed appropriately, for example,
file_path = '/user/ym2865/NHIS/model_file/'
in the code needs to be changed to your directory - For each code in all notebooks, there is a description on what this code corresponds to (e.g., generate data for Figure 1, or generate Figure 1).
- Hongseok Namkoong, Yuanzhe Ma, and Peter W. Glynn
- For any questions, please contact Yuanzhe Ma at ym2865@columbia.edu.
@article{NamkoongMaGlynn25,
author = {Namkoong, Hongseok and Ma, Yuanzhe and Glynn, Peter W.},
title = {Minimax Optimal Estimation of Stability Under Distribution Shift},
journal = {Operations Research},
year = {2025},
doi = {10.1287/opre.2022.0658}
}