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_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.2.1.2 in the Essential Introduction 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.
An unexpected error has been triggered by this function. Please contact
NAG.
See
Section 3.6.6 in the Essential Introduction for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 3.6.5 in the Essential Introduction for further information.
- 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.