Gaussian and Bionomial distributions
Project description
Introduction
Probability Distributions
A probability distribution is a statistical function that describes all the possible values and likelihoods that a random variable can take within a given range. This package includes two commonly used probability distributions, namely Gaussian distribution (or normal distribution) and Binomial Distribution.
How to install
you can install this package directly from the pypi repository using pip install:
pip install Gaus_Binom_probability
How to import and use the package
Open python or in your main python code import Gaussian and/or Binomial distributions from the package and use them as follows:
-
from Gaus_Binom_probability import Gaussian, Binomial -
The to make a Gaussian distribution you need to have the mean valu and the standard deviation value:
Gaussian(mean_value, stdev_value)
-
to read data that is generated by gaussian dist and to find their mean and stdev:
gaussian_1 = Gaussian(mean, stdev) #initialise your gaussian distributiongaussian_1.read_data_file(Folder_address+filename) #read your datagaussian_1.calculate_mean() #to calculate the meangaussian_1.calculate_stdev() #to calculate the stdevgaussian_1.plot_histogram() #to plot a histogram of your datagaussian_1.pdf(x) #to calculate the probability density functiongaussian_1.plot_histogram_pdf(number_of_data_points) #to plot the normalized histogram of the data and a plot of the probability density function along the same rangegaussian_1 + gaussian_2 #to add two gaussian functions (meaning add means and update the stdev)
-
To make a bionomial distribution you need to have the probability of the occurence of your event (for example probability of getting head in coin flipping) and the number of your tries or the size of your data:
Binomial(probability_of_occurence, size_of_data)
-
to read data and to find their mean and stdev:
binomial_1 = Binomial(p, n) #initialise your Binomial distributionbinomial_1.read_data_file(Folder_address+filename) #read your databinomial_1.calculate_mean() #to calculate the meanbinomial_1.calculate_stdev() #to calculate the stdevbinomial_1.replace_stats_with_data() #to calculate p and n from the data setbinomial_1.plot_bar() #to plot a histogram of your databinomial_1.pdf(x) #to calculate the probability density functionbinomial_1.plot_pdf(number_of_data_points) #to plot the pdf of the binomial distributiongaussian_1 + gaussian_2 #to add two Binomial functions (Note: p values of the two distributions should be the same.
Licensing
You can find info regarding the licensing in the license.txt file where the package is installed.
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
File details
Details for the file GausBinom_probability_Dist-0.3.tar.gz.
File metadata
- Download URL: GausBinom_probability_Dist-0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.17 tqdm/4.64.1 importlib-metadata/3.7.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31f687263b8d1b2ae616c4262bce95d8034b4f5e1071981f1596274faf621d4
|
|
| MD5 |
6ebaad8a85c96d43fdad8a1d1e0d76c8
|
|
| BLAKE2b-256 |
f2876e269227efd2ad7b3b87a2c10646ab507fc5789937eb9fc29ef74ded61f3
|