Giter VIP home page Giter VIP logo

ddus.jl's Introduction

Data-Driven Uncertainty Sets (DDUS)

Build Status Coverage Status

In the spirit of reproducible research, DDUS.jl contains implementations of many of the uncertainty sets from the paper

Data-Driven Robust Optimization by D. Bertsimas, V. Gupta and N. Kallus, Mathematical Programming 167.2 (2018): 235-292.

This paper is available from Mathematical Programming or the Vishal Gupta's website.

Uncertainty sets are implemented as "oracles" for use with JuMPeR.jl. Specifically, I have implemented oracles for each of the following sets (Eq. numbers refer to previous paper):

  • UM (Eq. 28)
  • UI (Eq. 18)
  • UFB (Eq. 23)
  • UCS (Eq. 35)
  • ULCX (Eq. 31)

More sets and additional features may be added going forward based on interest. For the most part, our implementations closely follow the descriptions in the paper. In a few places, we have opted for simpler, approximate formulae for improved efficiency where I felt the difference in practice was negligible.

Citation

If you find this package useful, please consider citing the above paper as:

@article{bertsimas2018data,
  title={Data-driven robust optimization},
  author={Bertsimas, Dimitris and Gupta, Vishal and Kallus, Nathan},
  journal={Mathematical Programming},
  volume={167},
  number={2},
  pages={235--292},
  year={2018},
  publisher={Springer}
}

Licensing

This code is available under the MIT License.
Copyright (c) 2016 Vishal Gupta

Also, if you use any portion of the software, I'd appreciate a quick note telling me the application. As an academic, I like hearing about when my work is used and when it (hopefully) has impact.

Usage

All our sets support JuMPeR's cutting plane functionality, but do not provide reformulations. Reformulation may be supported in the future based on need. A typical invocation might be:

using JuMPeR, DDUSets
dd_oracle = UCSOracle(data, epsilon, alpha)

m = RobustModel()
# ... Build up the model #

setDefaultOracle!(m, dd_oracle)  # to uses this oracle for all constraints

or

addConstraint(m, x[1] * us[1] + xs[2] * us[2] <= 5, dd_oracle)  #only for this one constraint

Most oracles support a simple constructor as above, taking in the data and two parameters, epsilon and alpha. Some oracles require additional information, such as the support of the uncertainty. (When in doubt, check the source file for the interface marked "preferred interface.")

All oracles assume that the data are given with each example in a row, and each column representing one component of the uncertainty. The ordering of the columns is important and is assumed to correspond to the index of the uncertainties in the optimization model. (That is, u[1] is the uncertainty whose data is given by column 1.) The parameters epsilon and alpha are described in detail the above paper, and roughly control the probability of infeasibility and the decision maker's tolerance for ambiguity, respectively. See also below on tuning these parameters.

Although fairly robust (punny), the preferred constructors for oracles can sometimes be slow because they perform all of the data analysis required to construct the set. When possible, one can reuse the same oracle for multiple constraints. When solving different optimization problems in a loop, one can also used the specialized constructors for the oracles to customize the data analysis step. (See the comments in the source code.)

Examples

The examples folder contains a simple portfolio allocation demonstrating typical usage of the sets.

Choosing the "Right" set and Tuning Epsilon and Alpha in Practice

The cited paper proves that under certain conditions, each of the above sets satisfy a strong probabilistic guarantee. In applications where it is important to have a provable guarantee on feasibility, those results can help guide the choice of set.

Many applications, however, do not require provably good performance, just practically good performance. In these cases, we suggest following the suggestions in Section 10 of the paper, and choosing the set, epsilon and alpha via cross-validation. Some generic functionality to do this will (hopefully) be added soon. In the meantime, ????? in the examples folder illustrates one possible cross-validation scheme for a particular example.

ddus.jl's People

Contributors

iainnz avatar vgupta1 avatar

Stargazers

Minjae Son avatar  avatar  avatar Daniele Gioia avatar  avatar  avatar seokwoo kim avatar TigerTigerGenerateWind avatar Andrew Keith avatar Ke Ma avatar  avatar

Watchers

 avatar James Cloos avatar Ke Ma avatar  avatar  avatar

ddus.jl's Issues

Multiple Constraints

The paper discusses optimizing the choice of epsilons when you have multiple constraints by

  • solving the original robust problem for a initial choice of epsilons
  • extracting the solution
  • solving a small auxiliary LP
  • updating the choice of epsilons with a gradient step

Again, it'd be nice to have a general facility for doing this. Thoughts @IainNZ ?

Handling bound constraints generically

Given an uncertainty set of form U = U_1 \cup U_2, a linear robust constraint over U can rewritten as

u^T x <= 0 for all u in U

as there exists x1, x2 such that

u^T x1 <= 0 for all u in U1
u^T x2 <= 0 for all u in U2
x1 + x2 = x

This suggests a way of decomposing complicated uncertainty sets into a portion for which there exists a nice reformulation and second portion for which we'd using cutting planes. In particular, for the sets in DDUS.jl we could handle additional constraints on the support intersected with the data-driven sets.

Ideally, I'm thinking something like:

#add some generic constraints, to be handled by general oracle
@defUnc(m, us[1:10] >=0)
addConstraint(m, sum(us) == 1)

#build a data-driven, or other complicated oracle
w = DDUS.UCSOracle( ... )

#add a robust constraint, designating the additional oracle
addConstraint(m, dot(us, xs) <= 0, w)

#solve... JuMP, or more likely the oracle itself, does the above decomposition on the back end to enforce both uncertainty sets.
solveRobust(m)

Thoughts @IainNZ ?

Cross-Validation for choosing epsilon/alpha/set

As discussed in the paper, it'd be nice to set up a general facility for using cross-validation (leveraging MLBase) to

  • Build a set using a part of the data
  • solve the optimization problem
  • test solution on remainder of data
  • amalgamate results
  • repeat for a grid of epsilon/alpha/choices of set

@IainNZ I'd be interested in your thoughts on what the architecture might look like to do this....

In the meantime, it's on my todo list to write an explicit example to doing this in an adhoc way for a set.

Reproducibility with new versions of Julia

Hi,

Thanks for your well-documented repository.
I failed to run the code using the Julia version 1. potentially because of the incompatibility of JuMPeR with these versions.
Earlier versions of Julia (version 0.) are also obsolete.
Do you have any suggestions on how I can reproduce your code?

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.