Welcome to the L3 Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿
>  Docs Center  >  IDL Reference  >  Advanced Math and Stats  >  IMSL_HYPERGEOCDF

### IMSL_HYPERGEOCDF

IMSL_HYPERGEOCDF

The IMSL_HYPERGEOCDF function evaluates the hypergeometric distribution function.

The IMSL_HYPERGEOCDF function evaluates the distribution function of a hypergeometric random variable with parameters n, l, and m. The hypergeometric random variable X can be thought of as the number of items of a given type in a random sample of size n that is drawn without replacement from a population of size l containing m items of this type.

The probability function is:

where i = max(0, n – l + m).

If k is greater than or equal to i and less than or equal to min(n, m), IMSL_BINOMIALCDF sums the terms in this expression for j going from i up to k; otherwise, 0 or 1 is returned, as appropriate. To avoid rounding in the accumulation, IMSL_BINOMIALCDF performs the summation differently, depending on whether or not k is greater than the mode of the distribution, which is the greatest integer in (m + 1) (n + 1)/(l + 2).

## Example

Suppose X is a hypergeometric random variable with n = 100, l = 1000, and m = 70. In this example, the distribution function is evaluated at 7.

`p = IMSL_HYPERGEOCDF(7, 100, 70, 1000)`
`PM, 'Pr(x <= 7) = ', p, FORMAT = '(a13,f7.4)'`

IDL prints:

`Pr(x <= 7) = 0.5995`

## Syntax

Result = IMSL_HYPERGEOCDF(K, N, M, L [, /DOUBLE])

## Return Value

The probability that K or fewer defectives occur in a sample of size N drawn from a lot of size L that contains M defectives.

## Arguments

### K

Parameter for which the hypergeometric distribution function is to be evaluated.

### L

Lot size. Parameter L must be greater than or equal to N and M.

### M

Number of defectives in the lot.

### N

Sample size. Argument n must be greater than or equal to k.

## Keywords

### DOUBLE (optional)

If present and nonzero, double precision is used.

## Errors

### Informational Errors

STAT_LESS_THAN_ZERO: Input parameter, k, is less than zero.

STAT_K_GREATER_THAN_N: Input parameter, k, is greater than the sample size.

### Fatal Errors

STAT_LOT_SIZE_TOO_SMALL: Lot size must be greater than or equal to n and m.

## Version History

 6.4 Introduced

© 2020 Harris Geospatial Solutions, Inc. |  Legal