Skip to main content

No project description provided

Project description

travis codecov pypi readthedocs

logo

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

A article in Elsevier Journal of Computational Science has been published introducing the software: here. If you are using this software in work that will be published, please cite this paper.

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
pip install -r requirements.txt
python setup.py install

The last command might need sudo prefix, depending on your python setup.

Optionally, to support more regression methods, install the Scikit-learn package:

pip install scikit-learn

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 = choaspy.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.0.6.tar.gz (155.1 kB view details)

Uploaded Source

Built Distributions

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

chaospy-3.0.6-py3-none-any.whl (260.0 kB view details)

Uploaded Python 3

chaospy-3.0.6-py2.py3-none-any.whl (260.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: chaospy-3.0.6.tar.gz
  • Upload date:
  • Size: 155.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for chaospy-3.0.6.tar.gz
Algorithm Hash digest
SHA256 0f5d79786a8b5dcf2037c80e23ed9d29984e8acfabb04ae50c451ed6d9c0c0c7
MD5 bc5c625e9202711cdf1c10590a0e9ab8
BLAKE2b-256 eea32500d3f11e9a846523a0893f179389ebb81f6f749aaa0fbf60bf38e695c0

See more details on using hashes here.

File details

Details for the file chaospy-3.0.6-py3-none-any.whl.

File metadata

  • Download URL: chaospy-3.0.6-py3-none-any.whl
  • Upload date:
  • Size: 260.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for chaospy-3.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 422d1c49cb6ed0d520415c8fe1435a451dba443325fddec85fd754ce47801df5
MD5 7ce82947c9161590582327b7eb0e6beb
BLAKE2b-256 08f9f4c4c55facf93fdd2c456d8cbab97fe3b44f8845f5d147013df8bbb48cb2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chaospy-3.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 260.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for chaospy-3.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8633ac4d2d83870a0a2c9f56ab0077e5ac2306f048cd9e556e8b4da7a3fa3413
MD5 7bf6a01d78bee16fd95cc9d58240be23
BLAKE2b-256 11ded8a0b7414985be47bb9d24d088149c706d3f34c843cf3b39ffd18cecc6cc

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