Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.8 KB

ab_test_dist_explorer.md

File metadata and controls

48 lines (35 loc) · 1.8 KB

Class ab_test_dist_explorer

This file contains a set of functions to help a user visualize each distribution.

Methods

  • beta_dist(alpha, beta)
    • requires - alpha and beta are non-negative integers. alpha signifies the successes, and beta signifies the failures. ex: alpha = 10, beta = 10. Sucess rate = 50% out of a population of 20.
    • modifies - returns a matplot lib object (show the plot with matplotlib.pyplot.show())
    • effects - none
  • gamma_dist(mean=None, var=None, alpha=None, beta=None)
    • requires - Inputs are in pairs, either [mean, variance] OR [alpha, beta]. Mean is on the inveval (-inf, inf), variance is greater than 0. Alpha and beta are both postive numbers.
    • modifies - returns a matplot lib object (show the plot with matplotlib.pyplot.show())
    • effects - none
  • lognormal_dist(mean, var)
    • requires - mean and variance of the log-normal distribution. Mean is on the inveval (-inf, inf), variance is greater than 0.
    • modifies - returns a matplot lib object (show the plot with matplotlib.pyplot.show())
    • effects - none
  • poisson_dist(lam)
    • requires - lambda is the average occurences per unit time in a poisson distribution. Lambda is non-negative.
    • modifies - returns a matplot lib object (show the plot with matplotlib.pyplot.show())
    • effects - none

Usage Guide

# import packages
from BayesABTest import ab_test_dist_explorer as pe
from matplotlib import pyplot as plt

# use the functions to plot a distribution
pe.beta_dist(20, 80)
plt.show()

Examples

Beta(20, 80) Distribution

alt text

Gamma(4, 2) Distribution

alt text

Poisson(15) Distribution

alt text