Evaluates the cumulative distribution function (CDF) for a hypergeometric distribution with population size N, subpopulation size K, and number of draws n at a value x.
N, subpopulation size K or draws n which is not a nonnegative integer, the function returns NaN.n or subpopulation size K exceeds population size N, the function returns NaN.input value
population size
subpopulation size
number of draws
evaluated CDF
var y = cdf( 1.0, 8, 4, 2 );
// returns ~0.786
var y = cdf( 1.5, 8, 4, 2 );
// returns ~0.786
var y = cdf( 2.0, 8, 4, 2 );
// returns 1.0
var y = cdf( 0, 8, 4, 2 );
// returns ~0.214
var y = cdf( NaN, 10, 5, 2 );
// returns NaN
var y = cdf( 0.0, NaN, 5, 2 );
// returns NaN
var y = cdf( 0.0, 10, NaN, 2 );
// returns NaN
var y = cdf( 0.0, 10, 5, NaN );
// returns NaN
var y = cdf( 2.0, 10.5, 5, 2 );
// returns NaN
var y = cdf( 2.0, 10, 1.5, 2 );
// returns NaN
var y = cdf( 2.0, 10, 5, -2.0 );
// returns NaN
var y = cdf( 2.0, 10, 5, 12 );
// returns NaN
var y = cdf( 2.0, 8, 3, 9 );
// returns NaN
Returns a function for evaluating the cumulative distribution function (CDF) for a hypergeometric distribution with population size N, subpopulation size K, and number of draws n.
population size
subpopulation size
number of draws
CDF
var mycdf = cdf.factory( 30, 20, 5 );
var y = mycdf( 4.0 );
// returns ~0.891
y = mycdf( 1.0 );
// returns ~0.031
Interface for the cumulative distribution function (CDF) of a hypergeometric distribution.