Skip to main content

Gaussian and Binomial distribution

Gaussian Class:

Attributes:

  • mean (float) representing the mean value of the distribution.
  • stdev (float) representing the standard deviation of the distribution.
  • data_list (list of floats) a list of floats extracted from the data file.

Methods:

  • init(self, mean=0, stdev=1)

  • read_data_file(self, file_name) Function to read in data from a txt file. The txt file should have one number (float) per line. The numbers are stored in the data attribute. Args: file_name (string): name of a file to read from Returns: None

  • calculate_mean(self) Function to calculate the mean of the data set. Args: None

      Returns: 
      	float: mean of the data set
    
  • calculate_stdev(self, sample=True) Function to calculate the standard deviation of the data set. Args: sample (bool): whether the data represents a sample or population Returns: float: standard deviation of the data set

  • plot_histogram(self) Function to output a histogram of the instance variable data using matplotlib pyplot library. Args: None Returns: None

  • pdf(self, x) Probability density function calculator for the gaussian distribution. Args: x (float): point for calculating the probability density function Returns: float: probability density function output

  • plot_histogram_pdf(self, n_spaces = 50) Function to plot the normalized histogram of the data and a plot of the probability density function along the same range Args: n_spaces (int): number of data points Returns: list: x values for the pdf plot list: y values for the pdf plot

  • add(self, other) Function to add together two Gaussian distributions Args: other (Gaussian): Gaussian instance Returns: Gaussian: Gaussian distribution

  • repr(self) Function to output the characteristics of the Gaussian instance Args: None Returns: string: characteristics of the Gaussian

Binomial class

Attributes

  • mean (float) representing the mean value of the distribution.
  • stdev (float) representing the standard deviation of the distribution.
  • data_list (list of floats) a list of floats extracted from the data file.
  • p (float) representing the probability of an event occurring
  • n (int) the total number of trials

Methods

  • init(self, p=.5, n=20)

  • calculate_mean(self): Function to calculate the mean from p and n Args: None Returns: float: mean of the data set

  • calculate_stdev(self): Function to calculate the standard deviation from p and n. Args: None Returns: float: standard deviation of the data set

  • replace_stats_with_data(self):
    Function to calculate p and n from the data set Args: None Returns: float: the p value float: the n value

  • plot_bar(self): Function to output a histogram of the instance variable data using matplotlib pyplot library. Args: None
    Returns: None

  • pdf(self, k): Probability density function calculator for the gaussian distribution. Args: k (float): point for calculating the probability density function Returns: float: probability density function output

  • plot_bar_pdf(self): Function to plot the pdf of the binomial distribution Args: None Returns: list: x values for the pdf plot list: y values for the pdf plot

  • add(self, other):
    Function to add together two Binomial distributions with equal p Args: other (Binomial): Binomial instance Returns: Binomial: Binomial distribution

  • repr(self):
    Function to output the characteristics of the Binomial instance Args: None Returns: string: characteristics of the Gaussian

Metadata

Release files for essdistributions 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for essdistributions 1.2
File Size Uploaded
essdistributions-1.2.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for essdistributions 1.2
File Interpreter ABI Platform
essdistributions-1.2-py2-none-any.whl Python 2 none any Details

Total release size: 14.4 kB

Release files / essdistributions-1.2.tar.gz

Download URL essdistributions-1.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b9c4ab20f2cad16d4a02477608fdf877e00458cf9c4b7a76373b77bdf9f391bd
BLAKE2b-256 checksum
How to use checksums
f9b4b74c52dad3d513d26ccd6c4d436a3acf80e543afbeb488026f4ce89532b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

Release files / essdistributions-1.2-py2-none-any.whl

Download URL essdistributions-1.2-py2-none-any.whl
Size 8.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a0db56d708bb69e4a7ca95f10e33fd23d25aea4988f52504441f183bbc9fe9d1
BLAKE2b-256 checksum
How to use checksums
f93cb9ac3174e5ba8460b813442ac5d625158d0601eef1b8235387d868ebc31f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page