Gaussian and Binomial distributions
Project description
Gaussian and Binomial Distributions
A basic package for calculating and visualizing Gaussian and Binomial Distributions. This is only a test.
How to import the classes using the interpret
$ python
>>> from gauss_binom_test import Gaussian, Binomial
Features
- Calculate the Gaussian and Binomial pdf of a data set
- Calculate the mean and standard deviation
- Calculate the sum of two pdfs
- Plot the histogram of data points and normalizdd histogram of the pdf
Example
Open the Python interpreter:
Create a standard normalmdistribution (zero mean and standard deviation equal to one)
>>> gaussian_normal = Gaussian()
>>> gaussian_normal
mean 0, standard deviation 1
Create a Gaussian distribution with mean=5 and stdv=2
>>> gaussian_one = Gaussian(5,2)
mean 5, standard deviation 2
Addition of two Gaussian distributions
>>> gaussian_sum = gaussian_normal + gaussian_one
>>> gaussian_sum.mean()
5
>>> sample stdev
>>> gaussian_sum.stdev()
2.2360679
Addition of three Gaussian distributions
>>> gaussian_sum = Gaussian(1,2) + Gaussian(2,3) + Gaussian(3,4)
>>> gaussian_sum
>>> mean 6, standard deviation 5.3851648
**Calculate the value of the Gaussian distribution function at a given point **
>>> gaussian_one = Gaussian(5,2)
>>> gaussian_one.pdf(6)
0.17603266338
Generate a Binomial distribution of 20 trials and 0.5 probability of an event occurring
>>> binom_one = Binomial(.5, 20)
>>> binom_one
mean 10.0, standard deviation 2.23606797749979, p 0.5, n 20
Calculate the probability of occurring 5 successes for a Binomial distribution of 20 trials and p=0.5
>>> Binomial(.5, 20).pdf(5)
0.0147857666015625
Adding two binomial distributions
>>> binom_sum = Binomial(.5, 20) + Binomial(.5, 10)
mean 15.0, standard deviation 2.7386127875258306, p 0.5, n 30
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
File details
Details for the file gauss_binom_test-0.2.4.tar.gz.
File metadata
- Download URL: gauss_binom_test-0.2.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f361d49d69fb43c67a9b48312c693833551d10906743782a6e2a44869129bde
|
|
| MD5 |
0dc53e1ba2d47b1f79bb19829e1b6a6a
|
|
| BLAKE2b-256 |
06e1eaad9016792ab489a5b08a7263239cc95b79944b9deb4a96a7e0e7dafd5f
|