Numerical tool for perfroming uncertainty quantification
Reason this release was yanked:
Not ready for prime time
Project description
Chaospy is a numerical tool for performing uncertainty quantification using polynomial chaos expansions and advanced Monte Carlo methods implemented in Python.
Installation
Installation should be straight forward:
pip install chaospy
And you should be ready to go.
Example Usage
chaospy is created to be simple and modular. A simple script to implement point collocation method will look as follows:
import numpy
import chaospy
Wrap your code in a function:
coordinates = numpy.linspace(0, 10, 100)
def foo(coordinates, params):
"""Function to do uncertainty quantification on."""
param_init, param_rate = params
return param_init*numpy.e**(-param_rate*coordinates)
Construct a multivariate probability distribution:
distribution = chaospy.J(chaospy.Uniform(1, 2), chaospy.Uniform(0.1, 0.2))
Construct polynomial chaos expansion:
polynomial_expansion = chaospy.generate_expansion(8, distribution)
Generate random samples from for example Halton low-discrepancy sequence:
samples = distribution.sample(1000, rule="halton")
Evaluate function for each sample:
evals = numpy.array([foo(coordinates, sample) for sample in samples.T])
Bring the parts together using point collocation method:
foo_approx = chaospy.fit_regression(
polynomial_expansion, samples, evals)
Derive statistics from model approximation:
expected = chaospy.E(foo_approx, distribution)
deviation = chaospy.Std(foo_approx, distribution)
sobol_main = chaospy.Sens_m(foo_approx, distribution)
sobol_total = chaospy.Sens_t(foo_approx, distribution)
For a more extensive guides on what is going on, see the tutorial collection.
Questions and Contributions
Please feel free to file an issue for:
bug reporting
asking questions related to usage
requesting new features
wanting to contribute with code
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
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 Distribution
Hashes for chaospy-4.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e35899fdda238f7cbd2ee825b83e991eeaa00b51d32f910a54d0364cb5cb2a2 |
|
MD5 | 2a7c4fee7466c18e85ceae373183c0ab |
|
BLAKE2b-256 | db19e81f2b4cc75dc933d39f7f555d7013adac1e7ac738935204da89dedced02 |