dHypergeometric

dHypergeometric(n, k, m, x)

The probability function of an hypergeometric distribution.

Parameters:
nint, n\geq 0

The population size

kint, 0\leq k\leq n

The number of candidates in the population

mint, 0\leq m\leq n

The number of individuals in a draw

xint, x\geq 0

The number of candidates in a draw

Returns:
pfloat

The probability to get x candidates in a draw.

Notes

This method is based on an algorithm similar to Loader’s algorithm, the fast and accurate method described in [loader2000], with the further improvements mentioned in [dimitriadis2016].

Examples

>>> import openturns as ot
>>> p = ot.DistFunc.dHypergeometric(10, 4, 7, 2)