No project description provided
Project description
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 to use this software in work that is published, please cite this paper.
Installation
Installation should be straight forward:
pip install chaospy
From Source
Alternativly, to get the most current 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 setupy.py install
The last command might need sudo prefix, depending on your python setup.
Optional Packages
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 as cp >>> import numpy as np >>> def foo(coord, prm): # your code wrapper goes here ... return prm[0] * np.e ** (-prm[1] * np.linspace(0, 10, 100)) >>> distribution = cp.J( ... cp.Uniform(1, 2), ... cp.Uniform(0.1, 0.2) ... ) >>> polynomial_expansion = cp.orth_ttr(8, distribution) >>> foo_approx = cp.fit_regression( ... polynomial_expansion, samples, evals) >>> expected = cp.E(foo_approx, distribution) >>> deviation = cp.Std(foo_approx, distribution)
For a more extensive description of what going on, see the tutorial. For a collection of reciepies, see the cookbook.
Testing
To test the build locally:
pip install -r requirements-dev.txt python setup.py test
It will run pytest-runner and execute all tests.
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
Built Distributions
Hashes for chaospy-2.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3370b7a94a7360a7797c56bf437bf1537f3ff135e36ee640bd959938516d1a5a |
|
MD5 | b93ee28561404890a3a03136bcdf481e |
|
BLAKE2b-256 | 4ee606c82da101a48a337c004020b9e8493ed69d858fc30943d3d638a5b64aa9 |
Hashes for chaospy-2.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c608a9d7dcc39137beea2756a5c8c4e54d015b50d2e7ecfbb509c7fd58c48de0 |
|
MD5 | ae05b2aac45af6703c604fccd400d353 |
|
BLAKE2b-256 | dfbe824847b74d80cd15da464fd57fc7fc75b4b2373c9c66b21c3ba8dc864892 |
Hashes for chaospy-2.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6edd77fc437fdd5279e68ff8e44f01dde1f2878f875402011636d5faee88ca79 |
|
MD5 | f2d2801b8e221bb9fba7899d5c5698e7 |
|
BLAKE2b-256 | 9624bfe11b92f1d9531b10ecd0888c766db4995a35cacbfd0cc2b7bdaee26839 |
Hashes for chaospy-2.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62b20e9d6ac2630ab2ba0e8150171c8f141dd0a1132c61f633c468ae4b6767d8 |
|
MD5 | b75919b5554fc4fb847ae8a19485d33c |
|
BLAKE2b-256 | 5922b90ba48be6505e0ce0efc684f9ccbff48cb721e4882eb3528bc402488287 |