Skip to main content

Robust decision making and exploratory modelling in Python

Project description

Rhodium

Test and Publish PyPI PyPI

Rhodium is an open source Python library for robust decision making (RDM) and multiobjective robust decision making (MORDM), and exploratory modelling (EM).

Citation

Please cite the following paper (PDF) if using this project in your own works:

Hadjimichael A, et al. 2020 Rhodium: Python Library for Many-Objective Robust Decision Making and Exploratory Modeling. Journal of Open Research Software, 8: 12. DOI: https://doi.org/10.5334/jors.293

Installation

To install the latest Rhodium release, run the following command:

pip install rhodium

To install the latest development version of Rhodium, run the following commands:

pip install -U build setuptools
git clone https://github.com/Project-Platypus/Rhodium.git
cd Rhodium
python -m build
python -m pip install --editable .

Rhodium has several optional dependencies that enable additional graphical and analytical capabilities.

  1. GraphViz - Required for CART figures (Cart#show_tree)
  2. pip install pywin32 - Required to connect to Excel models (ExcelModel)
  3. pip install openmdao - Required to connect to OpenMDAO models (OpenMDAOModel)
  4. pip install pyper - Required to connect to R models (RModel)
  5. J3Py - Interactive 3D visualizations

Resources

About

What is Robust Decision Making?

Robust Decision Making (RDM) is an analytic framework developed by Robert Lempert and his collaborators at RAND Corporation that helps identify potential robust strategies for a particular problem, characterize the vulnerabilities of such strategies, and evaluate trade-offs among them [2]. Multiobjective Robust Decision Making (MORDM) is an extension of RDM to account for problems with multiple competing performance objectives, enabling the exploration of performance tradeoffs with respect to robustness [3, 4].

What is Rhodium?

Rhodium is an open source Python library providing methods for RDM and MORDM. It follows a declarative design, where you tell Rhodium the actions or analyses you wish to perform and it determines the necessary calculations. Rhodium can interface with models written in a variety of languages, including Python, C and Fortran, R, and Excel. One begins by creating a Rhodium model:

from rhodium import *

def lake_problem(pollution_limit,
         b = 0.42,        # decay rate for P in lake (0.42 = irreversible)
         q = 2.0,         # recycling exponent
         mean = 0.02,     # mean of natural inflows
         stdev = 0.001,   # standard deviation of natural inflows
         alpha = 0.4,     # utility from pollution
         delta = 0.98,    # future utility discount rate
         nsamples = 100): # monte carlo sampling of natural inflows
    # add body of function
    return (max_P, utility, inertia, reliability)


model = Model(lake_problem)

model.parameters = [Parameter("pollution_limit"),
                    Parameter("b"),
                    Parameter("q"),
                    Parameter("mean"),
                    Parameter("stdev"),
                    Parameter("delta")]

model.responses = [Response("max_P", Response.MINIMIZE),
                   Response("utility", Response.MAXIMIZE),
                   Response("inertia", Response.MAXIMIZE),
                   Response("reliability", Response.MAXIMIZE)]

model.constraints = [Constraint("reliability >= 0.95")]

model.levers = [RealLever("pollution_limit", 0.0, 0.1, length=100)]

model.uncertainties = [UniformUncertainty("b", 0.1, 0.45),
                       UniformUncertainty("q", 2.0, 4.5),
                       UniformUncertainty("mean", 0.01, 0.05),
                       UniformUncertainty("stdev", 0.001, 0.005),
                       UniformUncertainty("delta", 0.93, 0.99)]

A Rhodium model consists of 6 parts:

  1. The underlying model (in this case, the Python function lake_problem).

  2. model.parameters - the parameters of interest.

  3. model.responses - the model responses or outputs.

  4. model.constraints - any hard constraints that must be satisfied.

  5. model.levers - parameters that we have direct control over.

  6. model.uncertainties - parameters that represent exogeneous uncertainties.

Once the Rhodium model is defined, you can then perform any analysis. For example, if we want to optimize the model and display the Pareto front:

output = optimize(model, "NSGAII", 10000)
scatter3d(model, output)
plt.show()

Check out the examples folder to see Rhodium in action!

References

  1. Rhodium logo by Tyler Glaude, Creative Commons License, https://thenounproject.com/term/knight/30912/
  2. Lempert, R. J., D. G. Groves, S. W. Popper, and S. C. Bankes (2006). A General, Analytic Method for Generating Robust Strategies and Narrative Scenarios. Management Science, 52(4):514-528.
  3. Kasprzyk, J. R., S. Nataraj, P. M. Reed, and R. J. Lempert (2013). Many objective robust decision making for complex environmental systems undergoing change. Environmental Modelling & Software, 42:55-71.
  4. Hadka, D., Herman, J., Reed, P.M., Keller, K. An Open Source Framework for Many-Objective Robust Decision Making. Environmental Modelling & Software, 74:114-129, 2015. DOI:10.1016/j.envsoft.2015.07.014. (View Online)
  5. Hadjimichael A, et al. 2020 Rhodium: Python Library for Many-Objective Robust Decision Making and Exploratory Modeling. Journal of Open Research Software, 8: 12. DOI: https://doi.org/10.5334/jors.293

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rhodium-1.4.0.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

Rhodium-1.4.0-py3-none-any.whl (80.4 kB view details)

Uploaded Python 3

File details

Details for the file rhodium-1.4.0.tar.gz.

File metadata

  • Download URL: rhodium-1.4.0.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for rhodium-1.4.0.tar.gz
Algorithm Hash digest
SHA256 ebea74f76e36d671c885cbcf9de768597ad8e1e8522c8a128a92a30692b11ddc
MD5 e5b1134b59952f193abe97aebd1c472a
BLAKE2b-256 142707ee8b685f0e5f51cb1104625b0d9cfdab7ccbc958dbd7c268aca5251d3d

See more details on using hashes here.

File details

Details for the file Rhodium-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: Rhodium-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 80.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for Rhodium-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faa5a968936de3dba2a4a7fb9ad5b6f06de86bcfa16cf2ff6700755f503c1c70
MD5 2fcc16471743ccc7c5c5ba2b23839579
BLAKE2b-256 800fb2003cc512b1e358304a6e5dd97781f94c6333bde9ea64bbd1b881d41195

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page