Created
October 28, 2019 01:56
-
-
Save JohnDeJesus22/cf58071333cc4c62c387fc859437b1af to your computer and use it in GitHub Desktop.
HgCDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hypergeom_cdf(N, A, n, t, min_value=None): | |
''' | |
Cumulative Density Funtion for Hypergeometric Distribution | |
:param N: population size | |
:param A: total number of desired items in N | |
:param n: number of draws made from N | |
:param t: number of desired items in our draw of n items up to t | |
:returns: CDF computed up to t | |
''' | |
if min_value: | |
return np.sum([hypergeom_pmf(N, A, n, x) for x in range(min_value, t+1)]) | |
return np.sum([hypergeom_pmf(N, A, n, x) for x in range(t+1)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment