Skip to main content

Numerical tool for perfroming uncertainty quantification

Project description

doc/.static/chaospy_logo.svg

circleci codecov pypi readthedocs

Chaospy is a numerical tool for performing uncertainty quantification using polynomial chaos expansions and advanced Monte Carlo methods implemented in Python 2 and 3.

If you are using this software in work that will be published, please cite the journal article: Chaospy: An open source tool for designing methods of uncertainty quantification

Installation

Installation should be straight forward:

pip install chaospy

And you should be ready to go.

Alternatively, to get the most current experimental version, the code can be installed from Github as follows:

git clone git@github.com:jonathf/chaospy.git
cd chaospy
git checkout <tag or branch of interest>
pip install .

Example Usage

chaospy is created to be simple and modular. A simple script to implement point collocation method will look as follows:

import chaospy
import numpy

# your code wrapper goes here
def foo(coord, prm):
    """Function to do uncertainty quantification on."""
    return prm[0] * numpy.e ** (-prm[1] * numpy.linspace(0, 10, 100))

# bi-variate probability distribution
distribution = chaospy.J(chaospy.Uniform(1, 2), chaospy.Uniform(0.1, 0.2))

# polynomial chaos expansion
polynomial_expansion = chaospy.orth_ttr(8, distribution)

# samples:
samples = distribution.sample(1000)

# evaluations:
evals = [foo(sample) for sample in samples.T]

# polynomial approximation
foo_approx = chaospy.fit_regression(
    polynomial_expansion, samples, evals)

# statistical metrics
expected = chaospy.E(foo_approx, distribution)
deviation = chaospy.Std(foo_approx, distribution)

For a more extensive description of what going on, see the tutorial.

For a collection of recipes, see the cookbook.

Questions & Troubleshooting

For any problems and questions you might have related to chaospy, please feel free to file an issue.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

chaospy-3.2.0.tar.gz (145.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chaospy-3.2.0-py2.py3-none-any.whl (236.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file chaospy-3.2.0.tar.gz.

File metadata

  • Download URL: chaospy-3.2.0.tar.gz
  • Upload date:
  • Size: 145.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.5 Linux/4.15.0-1052-aws

File hashes

Hashes for chaospy-3.2.0.tar.gz
Algorithm Hash digest
SHA256 4eaee8f7d686bbb6dec007a169bfb5425665bfd3ae85951df805e354279658b8
MD5 95d88e5869967d082ae5f3fbf7cc7199
BLAKE2b-256 6f8a75157e78162fdf2397ca541a504ddfbebc97c295fb959885b8ddb2eaaa85

See more details on using hashes here.

File details

Details for the file chaospy-3.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: chaospy-3.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 236.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.5 Linux/4.15.0-1052-aws

File hashes

Hashes for chaospy-3.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cff93e04d174e27c5c247172c0cac4564d3104e221670e24bfda48314fd9009b
MD5 92952a4a3013be7985f500c33b8fd058
BLAKE2b-256 cca5fdc8054e199f23a05681eaa94993527d2d2b74be4f381a55e2dd8392766e

See more details on using hashes here.

Supported by

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