Let
denote a random variable having a hypergeometric distribution with parameters
,
and
(
,
). Then
where
,
and
.
nag_hypergeom_dist (g01blc) computes for given
,
,
and
the probabilities:
The method is similar to the method for the Poisson distribution described in
Knüsel (1986).
- NE_2_INT_ARG_GT
-
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
- NE_4_INT_ARG_CONS
-
On entry, , , and .
Constraint: .
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- NE_ARG_TOO_LARGE
-
On entry,
n is too large to be represented exactly as a double precision number.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT_ARG_LT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
- NE_VARIANCE_TOO_LARGE
-
On entry, the variance exceeds .
The time taken by
nag_hypergeom_dist (g01blc) depends on the variance (see
Section 3) and on
. For given variance, the time is greatest when
(
the mean), and is then approximately proportional to the square-root of the variance.