Skip to main content

Measurement statistics with uncertainties and error propagation

Project description

A statistical package for measurement and population statistics that incorporate measurement uncertainties and error propagation.

Installation:

pip install measurement_stats

Error Propagation

Say, for example, that we have measured a rectangle to be 11 +/- 0.4 centimeters wide and 8 +/- 0.3 centimeters long. We can then calculate the area with uncertainty as follows:

from measurement_stats import ValueUncertainty

width = ValueUncertainty(11, 0.4)
length = ValueUncertainty(8, 0.3)

area = length * width

print('AREA:', area.label)
# $ AREA: 88 +/- 5

For a more complicated example, consider the canonical physics 101 experiment of trying to calculate the acceleration due to gravity using a pendulum. If a student has setup a pendulum with a measured length of 92.95 centimeters and an uncertainty of 0.1 centimeters and measured a period of that pendulum to be 1.936 seconds with an uncertainty of 0.004 seconds, the acceleration due to gravity, with propagated uncertainty, can be determined as follows:

from measurement_stats import ValueUncertainty

l = ValueUncertainty(92.95, 0.1)
T = ValueUncertainty(1.936, 0.004)

g = 4.0 * (math.pi ** 2) * l / (T ** 2)

print('Acceleration Due To Gravity:', g.label)
# $ Acceleration Due To Gravity: 979 +/- 4

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

measurement_stats-0.2.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

measurement_stats-0.2.2-py2.py3-none-any.whl (22.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file measurement_stats-0.2.2.tar.gz.

File metadata

File hashes

Hashes for measurement_stats-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3c7dafc010776e0ff20f38458d3c05e562e2fb2d5a2562af807976893f76e24f
MD5 264ea33bd4a6e48a2aad04b537b31838
BLAKE2b-256 ccdbb979af302cfe6dbfd67ed7c6d95863173fa62ad1b2329526da134f3bc88d

See more details on using hashes here.

File details

Details for the file measurement_stats-0.2.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for measurement_stats-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8fc7ae5c9e3f9121dc9ce82d5f9233176114b13fc6e809cb67e3a2f7bf455065
MD5 a290d8ddc401db1bfa51ed49f5788b53
BLAKE2b-256 31aa24c434ac8c81e0a241cc05240d09f3ba9cb70b6b26655c14f9802b544bd4

See more details on using hashes here.

Supported by

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