A python package that implements an easy-to-use interface for random variables, statistical distributions, and their algebra.
Project description
distribution-algebra
A python package that implements an easy-to-use interface for random variables, statistical distributions, and their algebra.
This Python package is brought to you by Vaibhav Karve.
distribution-algebra
recognizes Normal, Lognormal, Beta and Poisson
distributions. The package implements an interface to easily construct
user-defined Univariate distributions as well Vectorized distributions.
Additional features include:
- A
plot
function for probability density/mass function plotting. - A
draw
function for drawing random samples of specified size from a given distribution. - Addition and multiplication operations defined directly on distributions:
- For example, the sum of two Normal (Poisson) distributions is Normal (Poisson).
- The product of two Lognormal distributions is Lognormal.
- The sum of two arbitrary univariate distributions is expressed as a Vectorized distribution.
This package is written in Python v3.10, and is publicly available under the GNU-GPL-v3.0 license.
Installation and usage
To get started on using this package,
-
Istall Python 3.10 or higher.
-
python3.10 -m pip install distribution-algebra
-
Use it in a python script (or interactive REPL)
from distribution_algebra import Beta, Lognormal, Normal, Poisson x: Normal = Normal(mean=1.0, var=9.0) y: Normal = Normal(mean=1.0, var=16.0) assert x + y == Normal(mean=2.0, var=25.0)
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 distribution_algebra-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 923683f6b6c4a525624fe69a3148c8bca114cb00f791821aae8b4e1a2f7138ea |
|
MD5 | d0c90a2c2d39b508d9429acb2ffa6198 |
|
BLAKE2b-256 | ac108ad01cd4d782854ce5237d3420b0a71fe74209d70aa90756bdfc897adfce |
Hashes for distribution_algebra-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523c0c71c96b05989c4d2155fa7f1176039dc867d6d47c81bc4438824ca5a3c8 |
|
MD5 | 1b9fca1de4d9add733f581b6a231cf9d |
|
BLAKE2b-256 | 898ff47b29144e5956be0b606e4c9b368ac4da923332942d3f5c63be87354ce7 |