Rigorous computation with Uncertain Number in Python
Project description
PyUncertainNumber
Scientific computations of complex systems are surrounded by various forms of uncertainty, requiring appropriate treatment to maximise the credibility of computations. Empirical information for characterisation is often scarce, vague, conflicting and imprecise, requiring expressive uncertainty structures for trustful representation, aggregation and propagation.
This package is underpined by a framework of uncertain number which allows for a closed computation ecosystem whereby trustworthy computations can be conducted in a rigorous manner. It provides capabilities across the typical uncertainty analysis pipeline, encompassing characterisation, aggregation, propagation, and applications including reliability analysis and optimisation under uncertainty, especailly with a focus on imprecise probabilities.
Uncertain Number refers to a class of mathematical objects useful for risk analysis that generalize real numbers, intervals, probability distributions, interval bounds on probability distributions (i.e. probability boxes), and finite DempsterShafer structures. Refer to the documentation of this package for additional introduction.
Quick start
PyUncertainNumber can be used to easily create an UncertainNumber object, which may embody a mathematical construct such as PBox, Interval, Distribution, or DempsterShafer structure.
from pyuncertainnumber import UncertainNumber as UN
import pyuncertainnumber as pun
# a verbose to instantiate uncertain numbers with ancillary fields
e = UN(
name='elas_modulus',
symbol='E',
unit='Pa',
essence='pbox',
distribution_parameters=['gaussian', ([0,12],[1,4])])
# or simply use shortcut to create uncertain numbers
a = pun.normal([2,3], [1])
b = pun.normal([10,14], [1])
# specify a response function
def foo(x): return x[0] ** 3 + x[1] + 2
# intrusive call signature which allows for drop-in replacements
response = foo([a, b])
# alternatively, one can use a more generic call signature for propagation
p = pun.Propagation(vars=[a, b], func=foo, method='slicing', interval_strategy='direct')
response = p.run(n_slices=50)
Installation
Requirement: Python >=3.11
PyUncertainNumber can be installed from PyPI. Upon activation of your virtual environment, use the code below in your terminal. For additional instructions, refer to installation guide.
pip install pyuncertainnumber
Capabilities
PyUncertainNumberis a Python package for generic computational tasks focussing on rigourou uncertainty analysis, which provides a research-grade computing environment for uncertainty characterisation, propagation, validation and uncertainty extrapolation.PyUncertainNumbersupports probability bounds analysis to rigorously bound the prediction for the quantity of interest with mixed uncertainty propagation.PyUncertainNumberalso features great natural language support as such characterisatin of input uncertainty can be intuitively done by using natural language likeabout 7or simple expression like[15 +- 10%], without worrying about the elicitation.- Interoperability via serialization: features the save and loading of Uncertain Number objects to work with downstream applications.
- Yields informative results during the computation process such as the combination that leads to the maximum in vertex method.
UQ multiverse
UQ is a big world (like Marvel multiverse) consisting of abundant theories and software implementations on multiple platforms. We focus mainly on the imprecise probability frameworks. Some notable examples include OpenCossan, UQlab in Matlab and UncertaintyQuantification.jl, ProbabilityBoundsAnalysis.jl in Julia, and many others of course.
PyUncertainNumber is rooted in Python and has close ties with the Python scientific computing ecosystem, it builds upon and greatly extends a few pioneering projects, such as intervals, scipy-stats and pba-for-python to generalise probability and interval arithmetic. Beyond arithmetics, PyUncertainNumber has offered a wide spectrum of algorithms and methods for uncertainty characterisation, propagation, surrogate modelling, and optimisation under uncertainty, allowing imprecise uncertainty analysis in both intrusive and non-intrusive manner. PyUncertainNumber is under active development and will continue to be dedicated to support imprecise analysis in engineering using Python.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyuncertainnumber-0.1.1.tar.gz.
File metadata
- Download URL: pyuncertainnumber-0.1.1.tar.gz
- Upload date:
- Size: 148.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cae5f62bdb45bc766b532bd8db061b05755c3259094d44b76575ac18e0fe993
|
|
| MD5 |
be03ec699ffddcd5403ce7bcd9ae4020
|
|
| BLAKE2b-256 |
0e39b258d54ff128ab8a942037bab80885f35d2ddd72798c73f88ae106be1178
|
Provenance
The following attestation bundles were made for pyuncertainnumber-0.1.1.tar.gz:
Publisher:
python-publish.yml on leslieDLcy/PyUncertainNumber
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuncertainnumber-0.1.1.tar.gz -
Subject digest:
0cae5f62bdb45bc766b532bd8db061b05755c3259094d44b76575ac18e0fe993 - Sigstore transparency entry: 571589403
- Sigstore integration time:
-
Permalink:
leslieDLcy/PyUncertainNumber@07273957c07f18369a444323d49deeea0e63d844 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/leslieDLcy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@07273957c07f18369a444323d49deeea0e63d844 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyuncertainnumber-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyuncertainnumber-0.1.1-py3-none-any.whl
- Upload date:
- Size: 164.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6c9df7dcbc4dac31da9dfe46393c44d38ac298dbbdf6aee409eea7dce07fde6
|
|
| MD5 |
dbe53fb8cf237c4f500bbb36747d2c73
|
|
| BLAKE2b-256 |
994425cbac86701fb6de29c8dce26e0cdf438f5a36c7d8f339d646656f40e71b
|
Provenance
The following attestation bundles were made for pyuncertainnumber-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on leslieDLcy/PyUncertainNumber
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuncertainnumber-0.1.1-py3-none-any.whl -
Subject digest:
e6c9df7dcbc4dac31da9dfe46393c44d38ac298dbbdf6aee409eea7dce07fde6 - Sigstore transparency entry: 571589404
- Sigstore integration time:
-
Permalink:
leslieDLcy/PyUncertainNumber@07273957c07f18369a444323d49deeea0e63d844 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/leslieDLcy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@07273957c07f18369a444323d49deeea0e63d844 -
Trigger Event:
release
-
Statement type: