nag_hypergeom_dist (g01blc) returns the lower tail, upper tail and point probabilities associated with a hypergeometric distribution.
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_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.
- NE_VARIANCE_TOO_LARGE
-
On entry, the variance exceeds .
Not applicable.
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.