Skip to main content

ROBIST: Robust Optimization by Iterative Scenario Sampling and Statistical Testing

License: MIT DOI

This repository provides the code for applying ROBIST, a simple, yet effective, data-driven algorithm for optimization under parametric uncertainty. The methodology and numerical experiments are described in detail in an accompanying paper, available online here. The method was developed by Justin Starreveld, Guanyu Jin, Dick den Hertog and Roger Laeven.

Code

The code is written in Python, version 3.10.9. The dependency packages are listed in pyproject.toml. The ROBIST algorithm is implemented in src/robist/robist.py.

Installation

The recommended way to install robist in your (virtual) environment is with Python's pip:

pip install robist

To be able to run the numerical experiments, make sure to clone the repository and install with the examples-requirements:

git clone https://github.com/JustinStarreveld/ROBIST.git
cd robist
pip install ".[examples]"

Numerical Experiments

  1. Toy Problem (abbreviated as tp). We compare ROBIST with the methods of Calafiore & Campi (2005) and Yanıkoglu & den Hertog (2013) in examples/tp_experiments_cal2005_yan2013.py. Furthermore we analyze the performance of ROBIST in more detail in examples/tp_analysis.py.

  2. Portfolio Management Problem (abbreviated as pm). We compare ROBIST with the data-driven robust optimization approach proposed by Bertsimas et al. (2018) and the scenario optimization approach of Calafiore (2013) in examples/pm_experiments.py.

  3. Weighted Distribution Problem (abbreviated as wdp). We compare ROBIST with the scenario optimization methods of Calafiore & Campi (2005), Caré et al. (2014), Calafiore (2016) and Garatti et al. (2022) in examples/wdp_experiments.py.

  4. Two-Stage Lot-Sizing Problem (abbreviated as ls). We compare ROBIST with the method of Vayanos et al. (2012) in examples/ls_experiments.py.

For more information about these problems we refer to the preprint-paper.

Illustrative Example

We demonstrate ROBIST using the illustrative example as described in Section 2.2 of the paper.

Here we apply the algorithm to the following toy problem from Yanıkoglu & den Hertog (2013):

$$ \begin{align*} \max_{x_1,x_2 \leq 1}&x_1 + x_2 \ \text{s.t.}&z_1x_1+ z_2x_2 \leq 1, \end{align*} $$

where $z_1$ and $z_2$ are uncertain parameters, both uniformly distributed with support $[-1,1]$.

Suppose we have access to a data set of $N=200$ realizations of $(\tilde{z}_1, \tilde{z}_2)$ and would like the solution to be feasible with probability of at least 90%. We illustrate the application of ROBIST for this toy problem using the following figures.

First, we randomly split the data set into two equal-sized sets $\mathcal{D}^{train}_{N_1}$ and $\mathcal{D}^{\text{test}}_{N_2}$, each containing $100$ scenarios.

Data

We initialize the algorithm by optimizing for the expected/nominal scenario, i.e., $\bar{\mathbf{z}} = (z_1, z_2) = (0,0)$. This provides an initial solution: $\mathbf{x}_{0} = (x_1, x_2) = (1,1)$ with an objective value of 2. The next step is to use the training data $\mathcal{D}^{\text{train}}_{N_1}$ to evaluate the robustness of $\mathbf{x}_{0}$. This evaluation is illustrated in the following figure.

At iteration 0

We find that $\mathbf{x}_{0}$ does not meet the desired level of robustness, thus the algorithm will randomly pick one of the 13 currently violated scenarios (indicated by red stars) and add the scenario to our set of sampled scenarios to be optimized over. Suppose scenario $\hat{\mathbf{z}}^{11} = (0.96, 0.60)$ is chosen and we retrieve solution: $\mathbf{x}_{1} = (0.4,1)$ with an objective value of 1.4. Again, we can evaluate the robustness of our newly generated solution $\mathbf{x}_{1}$ using the scenarios in $\mathcal{D}^{\text{train}}_{N_1}$. This is depicted in the figure below.

At iteration 1

We find that $\mathbf{x}_{1}$ exceeds our desired level of robustness, thus the algorithm will remove a randomly picked scenario from our set of sampled scenarios in the following iteration. The algorithm continues adding or removing scenarios and evaluating the resulting solutions on $\mathcal{D}^{\text{train}}_{N_1}$ in this manner until either the time limit or iteration limit is reached.

Once the stopping criteria is reached, we use the "out-of-sample" test data $\mathcal{D}^{\text{test}}_{N_2}$ to properly evaluate each solution $\mathbf{x}_{i}$ and obtain valid "feasibility certificates". These evaluations can then be used to construct a trade-off curve and aid in choosing a solution. The blue line in the figure below depicts such a trade-off curve.

Trade-off curve

The script used to create the figures in this illustrative example is examples/tp_illustrative_plots.py.

Contact Information

Our code is not flawless. In case you have any questions or suggestions, please reach us at j.s.starreveld@uva.nl.

Citation

Was our software useful to you? Great! You can cite us using:

@misc{ROBIST,
  doi = {10.5281/zenodo.10143595},
  year = {2023},
  author = {Justin Starreveld, Guanyu Jin, Dick den Hertog and Roger JA Laeven},
  title = {ROBIST: Robust Optimization by Iterative Scenario Sampling and Statistical Testing},
  url = {https://github.com/JustinStarreveld/ROBIST}
}

Metadata

Release files for robist 2024.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robist 2024.2.0
File Size Uploaded Provenance Actions
robist-2024.2.0.tar.gz 13.7 kB Without provenance Details for robist-2024.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for robist 2024.2.0
File Interpreter ABI Platform Actions
robist-2024.2.0-py3-none-any.whl Python 3 none any Details for robist-2024.2.0-py3-none-any.whl

Total release size: 24.9 kB

Release files / robist-2024.2.0.tar.gz

Download URL robist-2024.2.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a2f96b9db10377b0f845845103ec194e3db1f0b1b1af18243c76cb455d3f116d
BLAKE2b-256 checksum
How to use checksums
c85ad8c6225c7482ac739aaa39b4951a5c8f6b87bcdc2225c5364bc4a996c630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / robist-2024.2.0-py3-none-any.whl

Download URL robist-2024.2.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5436b27933579f71f696878f1fc5e51b8e280888ce2ec2e099818685f842305d
BLAKE2b-256 checksum
How to use checksums
00324db5ae5156013eb1d213c8d10f75f81d38c0f2f347b5269babd3a75b9983
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Security for robist 2024.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2024.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page