Skip to content

Commit

Permalink
Fix bugs, update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
XiongPengNUS committed Jun 27, 2023
1 parent 1133c49 commit f8d4659
Show file tree
Hide file tree
Showing 65 changed files with 1,386 additions and 155 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
![GitHub issues](https://img.shields.io/github/issues-raw/XiongPengNUS/rsome)

- Website: [RSOME for Python](https://xiongpengnus.github.io/rsome/)
- PyPI: [RSOME 1.2.0](https://pypi.org/project/rsome/)
- PyPI: [RSOME 1.2.1](https://pypi.org/project/rsome/)

RSOME (Robust Stochastic Optimization Made Easy) is an open-source Python package for generic modeling of optimization problems (subject to uncertainty). Models in RSOME are constructed by variables, constraints, and expressions that are formatted as N-dimensional arrays. These arrays are consistent with the NumPy library in terms of syntax and operations, including broadcasting, indexing, slicing, element-wise operations, and matrix calculation rules, among others. In short, RSOME provides a convenient platform to facilitate developments of robust optimization models and their applications.

Expand Down
73 changes: 36 additions & 37 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.5.1)
activesupport (6.1.7.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.23.7)
concurrent-ruby (1.1.10)
dnsruby (1.61.9)
simpleidn (~> 0.1)
commonmarker (0.23.9)
concurrent-ruby (1.2.2)
dnsruby (1.70.0)
simpleidn (~> 0.2.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.8.1)
faraday (2.5.2)
faraday (2.7.7)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.0)
faraday-net_http (3.0.2)
ffi (1.15.5)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (227)
github-pages (228)
github-pages-health-check (= 1.17.9)
jekyll (= 3.9.2)
jekyll (= 3.9.3)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.2.0)
jekyll-commonmark-ghpages (= 0.4.0)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
Expand Down Expand Up @@ -71,7 +71,7 @@ GEM
jemoji (= 0.12.0)
kramdown (= 2.3.2)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.3)
liquid (= 4.0.4)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.13.6, < 2.0)
Expand All @@ -83,17 +83,17 @@ GEM
octokit (~> 4.0)
public_suffix (>= 3.0, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.2)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (0.9.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (3.9.2)
jekyll (3.9.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
Expand All @@ -109,11 +109,11 @@ GEM
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.4.0)
commonmarker (~> 0.22)
jekyll-commonmark-ghpages (0.2.0)
commonmarker (~> 0.23.4)
jekyll-commonmark-ghpages (0.4.0)
commonmarker (~> 0.23.7)
jekyll (~> 3.9.0)
jekyll-commonmark (~> 1.4.0)
rouge (>= 2.0, < 4.0)
rouge (>= 2.0, < 5.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.15.1)
Expand Down Expand Up @@ -201,27 +201,27 @@ GEM
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.16.3)
nokogiri (1.14.2-arm64-darwin)
minitest (5.18.1)
nokogiri (1.13.10-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-linux)
nokogiri (1.13.10-x86_64-darwin)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.2)
racc (1.7.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand All @@ -242,26 +242,25 @@ GEM
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.10)
thread_safe (~> 0.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
webrick (1.7.0)
zeitwerk (2.6.0)
webrick (1.8.1)
zeitwerk (2.6.8)

PLATFORMS
arm64-darwin-21
x86_64-linux
universal-darwin-22

DEPENDENCIES
commonmarker
github-pages
webrick (~> 1.7)

BUNDLED WITH
2.3.7
2.2.7
2 changes: 1 addition & 1 deletion docs/_site/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
3 changes: 2 additions & 1 deletion docs/_site/dro_rsome.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down Expand Up @@ -592,6 +592,7 @@ <h2 id="the-worst-case-expectations-">The Worst-Case Expectations <a name="secti

<h2 id="application-examples-">Application Examples <a name="section3.6"></a></h2>
<h3 id="distributionally-robust-portfolio"><a href="example_dro_portfolio">Distributionally Robust Portfolio</a></h3>
<h3 id="distributionally-robust-portfolio-under-moment-uncertainty"><a href="example_moment_uncertainty_portfolio">Distributionally Robust Portfolio under Moment Uncertainty</a></h3>
<h3 id="distributionally-robust-medical-appointment"><a href="example_dro_mas">Distributionally Robust Medical Appointment</a></h3>
<h3 id="mean-risk-portfolio-optimization-with-a-wasserstein-ambiguity-set"><a href="example_dro_wass_portfolio">Mean-Risk Portfolio Optimization with a Wasserstein Ambiguity Set</a></h3>
<h3 id="robust-satisficing-for-portfolio-optimization"><a href="example_dro_rs_portfolio">Robust Satisficing for Portfolio Optimization</a></h3>
Expand Down
1 change: 1 addition & 0 deletions docs/_site/dro_rsome.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ model.st(2x >= z) # worst-case over the support of fset

## Application Examples <a name="section3.6"></a>
### [Distributionally Robust Portfolio](example_dro_portfolio)
### [Distributionally Robust Portfolio under Moment Uncertainty](example_moment_uncertainty_portfolio)
### [Distributionally Robust Medical Appointment](example_dro_mas)
### [Mean-Risk Portfolio Optimization with a Wasserstein Ambiguity Set](example_dro_wass_portfolio)
### [Robust Satisficing for Portfolio Optimization](example_dro_rs_portfolio)
Expand Down
Binary file added docs/_site/example_dro_cvar_moment_dec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_site/example_dro_finpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_inv.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_mas.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_nv.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
4 changes: 2 additions & 2 deletions docs/_site/example_dro_portfolio.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down Expand Up @@ -73,7 +73,7 @@ <h3 id="distributionally-robust-portfolio">Distributionally Robust Portfolio</h3
&amp; \pmb{x} \in \mathbb{R}^J_+.
\end{align}\]

<p>Here we assume that a commonly used utility function is piecewise affine and concave such that \(U(y) = \min_{k \in [K]} \left\{\alpha_k y + \beta_k\right\}\) with \(\alpha_k \geq 0\). We also assume the mean returns, the variance of each option, as well as the variance of sum of these options are known, captured by the widely used partial cross-moment ambiguity set (<a href="#ref1">Bertsimas et al. 2019</a>, <a href="#ref3">Delgage and Ye 2010</a>, <a href="#ref4">Wiesemann et al. 2014</a>):</p>
<p>Here we assume that a commonly used utility function is piecewise affine and concave such that \(U(y) = \min_{k \in [K]} \left\{\alpha_k y + \beta_k\right\}\) with \(\alpha_k \geq 0\). We also assume the mean returns, the variance of each option, as well as the variance of sum of these options are known, captured by the widely used partial cross-moment ambiguity set (<a href="#ref1">Bertsimas et al. 2019</a>, <a href="#ref3">Delage and Ye 2010</a>, <a href="#ref4">Wiesemann et al. 2014</a>):</p>

\[\mathcal{G} =
\left\{
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_portfolio.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $$
\end{align}
$$

Here we assume that a commonly used utility function is piecewise affine and concave such that \\(U(y) = \min_{k \in [K]} \left\\{\alpha_k y + \beta_k\right\\}\\) with \\(\alpha_k \geq 0\\). We also assume the mean returns, the variance of each option, as well as the variance of sum of these options are known, captured by the widely used partial cross-moment ambiguity set ([Bertsimas et al. 2019](#ref1), [Delgage and Ye 2010](#ref3), [Wiesemann et al. 2014](#ref4)):
Here we assume that a commonly used utility function is piecewise affine and concave such that \\(U(y) = \min_{k \in [K]} \left\\{\alpha_k y + \beta_k\right\\}\\) with \\(\alpha_k \geq 0\\). We also assume the mean returns, the variance of each option, as well as the variance of sum of these options are known, captured by the widely used partial cross-moment ambiguity set ([Bertsimas et al. 2019](#ref1), [Delage and Ye 2010](#ref3), [Wiesemann et al. 2014](#ref4)):

$$
\mathcal{G} =
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_rs_portfolio.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_vehicle.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_dro_wass_portfolio.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/example_max_volume_box.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down
10 changes: 5 additions & 5 deletions docs/_site/example_min_ellipsoid.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>RSOME in Python by XiongPengNUS</title>

<link rel="stylesheet" href="/assets/css/styles.css?v=ad85233a705aa05f30500755954726d44026f23d">
<link rel="stylesheet" href="/assets/css/styles.css?v=1133c49022053655fa92e79972cc63c5f2737f41">
<meta name="viewport" content="width=device-width">

<!-- Place this tag in your head or just before your close body tag. -->
Expand Down Expand Up @@ -124,9 +124,9 @@ <h3 id="minimal-enclosing-ellipsoid">Minimal Enclosing Ellipsoid</h3>

<p>The Python code for implementing the model above is presented below.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">rsome.rsome</span> <span class="kn">import</span> <span class="n">ro</span>
<span class="kn">from</span> <span class="nn">rsome.rsome</span> <span class="kn">import</span> <span class="n">msk_solver</span> <span class="k">as</span> <span class="n">msk</span>
<span class="kn">import</span> <span class="nn">rsome.rsome</span> <span class="k">as</span> <span class="n">rso</span>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">rsome</span> <span class="kn">import</span> <span class="n">ro</span>
<span class="kn">from</span> <span class="nn">rsome</span> <span class="kn">import</span> <span class="n">msk_solver</span> <span class="k">as</span> <span class="n">msk</span>
<span class="kn">import</span> <span class="nn">rsome</span> <span class="k">as</span> <span class="n">rso</span>

<span class="n">model</span> <span class="o">=</span> <span class="n">ro</span><span class="p">.</span><span class="n">Model</span><span class="p">()</span>

Expand Down Expand Up @@ -177,7 +177,7 @@ <h3 id="minimal-enclosing-ellipsoid">Minimal Enclosing Ellipsoid</h3>
<span class="n">plt</span><span class="p">.</span><span class="n">show</span><span class="p">()</span>
</code></pre></div></div>

<p><img src="min_ellipsoid.png" alt="" /></p>
<p><img src="/min_ellipsoid.png" alt="" /></p>


</section>
Expand Down
6 changes: 3 additions & 3 deletions docs/_site/example_min_ellipsoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ xs[:, 1] = xs[:, 0]*0.08 + xs[:, 1]
The Python code for implementing the model above is presented below.

```python
from rsome.rsome import ro
from rsome.rsome import msk_solver as msk
import rsome.rsome as rso
from rsome import ro
from rsome import msk_solver as msk
import rsome as rso

model = ro.Model()

Expand Down
Loading

0 comments on commit f8d4659

Please sign in to comment.