Greg_Deckler's avatar
Greg_Deckler
Community Champion
7 years ago

Hypergeometric Distribution Formula

As explained here: https://www.statisticshowto.datasciencecentral.com/hypergeometric-distribution-examples/

 

The hypergeometric distribution is a probability distribution that’s very similar to the binomial distribution. In fact, the binomial distribution is a very good approximation of the hypergeometric distribution as long as you are sampling 5% or less of the population.


Therefore, in order to understand the hypergeometric distribution, you should be very familiar with the binomial distribution. Plus, you should be fairly comfortable with the combinations formula.

 

Hypergeometric Distribution Formula

The (somewhat formal) definition for the hypergeometric distribution, where X is a random variable, is:

 

This Quick Measure does the calculation above and has a bunch of error checking to boot.

 

 

 

Probability = 
VAR __error = IF(ISBLANK(K[K Value]) || ISBLANK('k 2'[k Value 2]) || ISBLANK(N[N Value]) || ISBLANK([n Value 2]) || [n Value 2]<'k 2'[k Value 2] || K[K Value]<'k 2'[k Value 2] || N[N Value]<'n 2'[n Value 2] || N[N Value]<K[K Value],TRUE(),FALSE())
VAR __numerator = IF(__error,1,COMBIN(K[K Value],'k 2'[k Value 2])*COMBIN(N[N Value]-K[K Value],'n 2'[n Value 2]-'k 2'[k Value 2]))
VAR __demoninator = IF(__error,1,COMBIN(N[N Value],'n 2'[n Value 2]))
RETURN
IF(__error,"Bad Parameters",DIVIDE(__numerator,__demoninator,0))

 

 

No RepliesBe the first to reply