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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1c657be0d0b06f8c150b81f6faea966f6307664d831d0bd719aff510778f67b |
|
MD5 | dda964b87e87871654295116b6f82d32 |
|
BLAKE2b-256 | 967598d5548838269c0ef96374134646d9d367ef8df9f64e200b2f4f7588534c |
Hashes for distribution_algebra-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acfa4775688cfaa417290b675b5642d9b54798b20eb3e4374b6ff98f66e31ac8 |
|
MD5 | f713b192c6bf646f69a1e3edaf94d381 |
|
BLAKE2b-256 | 37e494db02a0e45992235dfd01dd2d9b9932f38064df07785c291d3245a7ff45 |