naginterfaces.library.stat.prob_​hypergeom

naginterfaces.library.stat.prob_hypergeom(n, l, m, k)[source]

prob_hypergeom returns the lower tail, upper tail and point probabilities associated with a hypergeometric distribution.

For full information please refer to the NAG Library document for g01bl

https://www.nag.com/numeric/nl/nagdoc_28.4/flhtml/g01/g01blf.html

Parameters
nint

The parameter of the hypergeometric distribution.

lint

The parameter of the hypergeometric distribution.

mint

The parameter of the hypergeometric distribution.

kint

The integer which defines the required probabilities.

Returns
plekfloat

The lower tail probability, .

pgtkfloat

The upper tail probability, .

peqkfloat

The point probability, .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, , , and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, is too large to be represented exactly as a double precision number.

(errno )

On entry, the variance exceeds .

Notes

Let denote a random variable having a hypergeometric distribution with parameters , and (, ). Then

where , and .

The hypergeometric distribution may arise if in a population of size a number are marked. From this population a sample of size is drawn and of these are observed to be marked.

The mean of the distribution , and the variance .

prob_hypergeom computes for given , , and the probabilities:

The method is similar to the method for the Poisson distribution described in Knüsel (1986).

References

Knüsel, L, 1986, Computation of the chi-square and Poisson distribution, SIAM J. Sci. Statist. Comput. (7), 1022–1036