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,
-
Install 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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf3d9e5fb47d3ee6282c26e76dfa5c4ebd981c7718d639e4338c87b1b217c3fc |
|
MD5 | 5d40762f9c0dad819701c0c19795effb |
|
BLAKE2b-256 | bf856fe74add4d57627f7948544676ae0f2c9135a6206d396695769dc400cb75 |
Hashes for distribution_algebra-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 179d45632c1aeb2a5b92a32d512cb055df83cd591750e389ff6e38f64cfd6579 |
|
MD5 | a5426cde4fac810c4c02865bc603d7df |
|
BLAKE2b-256 | 24a64057c076893328f13e8ede18d0bbac0dda44665c429e7715c833f74c9792 |