Probabilities.HypGeometricPDF Method

Overload List

#SignatureDescription
1function HypGeometricPDF(x: Integer; M: Integer; K: Integer; N: Integer): Double;Hypergeometric probability mass function (PMF).
2procedure HypGeometricPDF(const X: TMtxVecInt; M: Integer; K: Integer; N: Integer; const Res: TDenseMtxVec);Hypergeometric distribution PDF (vectorized).

Overload 1: function HypGeometricPDF(x: Integer; M: Integer; K: Integer; N: Integer): Double;

Hypergeometric probability mass function (PMF).

#NameDescription
1xDistribution domain, integer (number of successes drawn).
2MTotal number of elements in the population, M>=0.
3KNumber of elements with the desired trait, 0<=K<=M.
4NNumber of samples drawn without replacement, 0<=N<=M.

Returns: Double - the hypergeometric probability mass function (PMF) at x for population M, K success states and N draws. Returns NAN on parameter violations; 0 outside the support.

Remarks:

Computes the hypergeometric PMF, the probability of drawing exactly x of the K success items in N draws without replacement from a population of M:

PMF(x| M,K,N)=(dbinomKxdbinomM-KN-x)/dbinomMN

Support: max(0,N-(M-K)) <= x <= min(K,N). The result is NaN when M,K,N<0,K>M,N>M,x>Norx>KM,K,N<0`,`K>M`,`N>M`,`x>N`or`x>K, and 0 outside the support.

See Also: Probabilities.HypGeometricCDF, Probabilities.HypGeometricCDFInv

Overload 2: procedure HypGeometricPDF(const X: TMtxVecInt; M: Integer; K: Integer; N: Integer; const Res: TDenseMtxVec);

Hypergeometric distribution PDF (vectorized).

#NameDescription
1XDistribution domain, with integer values on closed interval [0,N].
2MDefines total number of elements, valid values ae integers on closed interval [0,X].
3KDefines number of elements with certain traits, valid values are integers on closed interval [X,M].
4NDefines number of samples, valid values are integers on closed interval [X,M].
5ResAfter calculation stores the PDF calculated from X, K, M and N. Length and Complex properties of Res are adjusted automatically to match Length and Complex properties of X.

Result: stored in self (calling object)