Hypergeometric distribution entropy.
The entropy (in nats) for a hypergeometric random variable is
where N is the population size, K is the subpopulation size, and n is the number of draws.
var entropy = require( '@stdlib/stats/base/dists/hypergeometric/entropy' );Returns the entropy of a hypergeometric distribution with parameters N (population size), K (subpopulation size), and n (number of draws).
var v = entropy( 16, 11, 4 );
// returns ~1.216
v = entropy( 2, 1, 1 );
// returns ~0.693If provided NaN for any parameter, the function returns NaN.
var v = entropy( NaN, 10, 4 );
// returns NaN
v = entropy( 20, NaN, 4 );
// returns NaN
v = entropy( 20, 10, NaN );
// returns NaNIf provided a parameter that is not a nonnegative integer, the function returns NaN.
var v = entropy( 10.5, 5, 2 );
// returns NaN
v = entropy( 10, 1.5, 2 );
// returns NaN
v = entropy( 10, 5, -2.0 );
// returns NaNIf the number of draws n exceeds the population size N, the function returns NaN.
var v = entropy( 10, 5, 12 );
// returns NaNIf the subpopulation size K exceeds the population size N, the function returns NaN.
var v = entropy( 10, 12, 5 );
// returns NaNvar entropy = require( '@stdlib/stats/base/dists/hypergeometric/entropy' );
var v = entropy( 16, 11, 4 );
console.log( v );
// => 1.2156868611027067
v = entropy( 2, 1, 1 );
console.log( v );
// => 0.6931471805599453
v = entropy( 10, 5, 12 );
console.log( v );
// => NaN