Mathematical calculations with uncertain numbers
Project description
UNCERTAIN
Python module to keep track of uncertainties in mathematical calculations.
Usage example
Input:
from uncertain import *
a = UncertainValue(5, 3, 8, 'normal', [5, 1])
b = UncertainValue(1, 0.1, 4)
c = -b+2*a**(b/3)
print(c.describe(),
"\n\nThe standard deviation of b is "+str(b.std),
"\n\nThe probability of /c/ being between 2 and 6 is " +
str(probability_in_interval(c, [2, 6])))
a.plot_distribution(title="Uncertain numbers", label="a")
b.plot_distribution(label="b", alpha=0.5)
c.plot_distribution(label="c", alpha=0.5)
c.plot_distribution(plot_type='cdf', new_figure=True)
Output:
This variable is an uncertain value. It has the following properties:
- Nominal value: 2.4199518933533937
- Mean: 5.1973349566661415
- Median: 3.8063419262133795
- Variance: 13.086116036143682
- Standard deviation: 3.6174737091157527
- Skewness: 1.5519941650511524
- Lower bound: -1.9254016053940988
- Percentile 5: 2.0248565203431506
- Q1: 2.432100693608657
- Q3: 6.832833238201248
- Percentile 95: 12.808458201483177
- Upper bound: 31.899999999999995
- Probability distribution type: custom
- Number of samples: 100000
The standard deviation of b is 1.1245368594834484
The probability of /c/ being between 2 and 6 is 0.67164
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
uncertain-0.0.3.tar.gz
(17.4 kB
view details)
Built Distribution
uncertain-0.0.3-py3-none-any.whl
(18.2 kB
view details)
File details
Details for the file uncertain-0.0.3.tar.gz
.
File metadata
- Download URL: uncertain-0.0.3.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 851c974c220c89ab6c4a1ea81007107ca8df35ff85cda17d4ca3b0c0f4e94f22 |
|
MD5 | 4ee507dbb074ae0af76013a6379fd5cc |
|
BLAKE2b-256 | 2b6b9a0f13715ca4afd13cf74cdee0219cafaf5b94759469b4e64ffb8642ab89 |
File details
Details for the file uncertain-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: uncertain-0.0.3-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f094cb6367df696d831437028569451e159601984cba18086dafe6ce7d079d1d |
|
MD5 | 6aeab6ace9e5e36e160f64064bf0f16d |
|
BLAKE2b-256 | 295a44f5ee1a4a43f629c581eb1a71883c9a1aab8f10c228fa7d156c046f2a4d |