Skip to main content

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

Probability density
Cumulative density

Project details


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.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

uncertain-0.0.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file uncertain-0.0.1.tar.gz.

File metadata

  • Download URL: uncertain-0.0.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for uncertain-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ab38fc0b5d12292ec32939b0b47b92c6bb9a9aa88416b2589815faf3bb94fb3f
MD5 219f57831e7d2e12162f3e9acf97ff9d
BLAKE2b-256 dfb52ee186603ce3d7c3512f49b54664018b21ce5f7823b45504645ba57ebe2a

See more details on using hashes here.

File details

Details for the file uncertain-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: uncertain-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for uncertain-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 861ab37b53ee746c918c56c6c304c8fe1fd192c7f96739826881c92e7db0807c
MD5 32928768e547b0dffbff79dfb5abb289
BLAKE2b-256 08020c5da379870786a758d77a44b7751a691dc36ce9fe1fed897e95a695032b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page