Skip to main content

This is a package for common distributions, e.g. Gaussian, Binomial

Project description

Distribution: A package to demonstrate a few statistical distributions

This tq010or-distribution package is a demo for a few statistical distributions.

Features

  • Can sample from the distribution
  • Can estimate distribution parameters with samples
  • Easy plot integration
  • Support Gaussian and Binomial (as of July 2020)
  • Extensible to include other distributions

Installation

  • Operating system: Linux · Windows (Cygwin, MinGW, Visual Studio)
  • Python version: Python 3.6+

pip

pip install tq010or-distribution

Or you can install them in your virtual environment:

python -m venv .env
source .env/bin/activate
pip install tq010or-distribution

Usage

>>> from distributions.gaussian import Gaussian
>>> g = Gaussian(0, 1)
>>> print(g)
Gaussian(0, 1)
>>> samples = g.sample(10000)
>>> ge = Gaussian.estimate(samples)
>>> print(ge)
Gaussian(0.016869274639641572, 0.9910041611791893)
>>> g1 = Gaussian(0, 3)
>>> g2 = Gaussian(1, 4)
>>> g3 = g1 + g2
>>> assert g3 == g1 + g2
>>> 

Run tests

python -c "import os; import distributions; print(os.path.dirname(distributions.__file__))"
pip install -r path/to/requirements.txt
python -m pytest <distributions-directory>

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

tq010or-distributions-0.0.1rc0.tar.gz (5.5 kB view hashes)

Uploaded Source

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