Dew MtxVec NET
HypGeometricPDF Routines
Summary
Hypergeometric probability density function (PDF).

Unit
Probabilities

Declaration
Function HypGeometricPDF(x: Integer; M, K, N: Integer): TSample;
Result
the hypergeometric probability density function (PDF) for value x using the integer parameters M (total number of elements), K (number of elements with a certain trait) and N (number of samples drawn). All the parameters M, K N must be greater or equal than zero, M >= N, M >= K, N >= X, K >= x. If not all of these conditions are met, the result is NAN.
Description
Calculates the hypergeometric distribution probability density function. The hypergeometric probability density function is defined by the following equation:

where M is the total size of elements, K is the number of elements with desired trait and N is the number of samples drawn.
The function returns the probability of drawing exactly x elements of a possible K in N drawings without replacement from group of M elements.
Sampling from a finite population can be done in one of two ways. An item can be selected, examined, and returned to the population for possible reselection; or it can be selected, examined, and kept, thus preventing its reselection in subsequent draws. The former is called sampling with replacement, whereas the later is called sampling without replacement. Sampling with replacement guarantees that the draws are independent. In sampling without the replacement the draws are not independent. Thus if we sample without replacement, the random variable x, the number of successes in N draws, is no longer binomial. Rather, it follows a hypergeometric distribution.
If the number of items sampled (N) is small relative to the number of objects from which the sample is drawn (M), then the BinomPDF distribution can be used to approximate hypergeometric probability. Parameters:Support: x: (0,1,2,3,...)
Categories
Discrete probabilities
 See Also 
HypGeometricCDF 
HypGeometricCDFInv 

Declaration
Procedure HypGeometricPDF(X: TDenseMtxVec; M, K, N: Integer; Res: TDenseMtxVec);

Description
Calculates the HyperGeometric PDF for vector X using the parameters M, K and N. The results are stored in vector Res. The Res Length and Complex properties are adjusted automatically. If vector X is complex, an exception is raised.

Copyright 2008 Dew Research
http://www.dewresearch.com