hygecdf

 

Description

Hypergeometric distribution cdf. Computes the probabilities in given value , associated with a hypergeometric distribution

The lower tailed probability of the hypergeometric distribution

P(X\leq k)=\sum_{i=0}^kP(X=i)=\sum_{i=0}^k\frac {{m \choose i}{n-m \choose l-i} }{{n \choose l} }

where

  • n: The population size
  • m: The number of success states in the population
  • l: The number of samples drawn

Syntax

double hygecdf( const int iK, int m, int n, int l, int iTail = TAILED_TEST_DISC_LOWER, int * nFail = NULL )

Parameters

iK
[input] integer k which defines the required probabilities.
m
[input] parameter m of the hypergeometric distribution.
n
[input] parameter n of the hypergeometric distribution.
l
[input] parameter l of the hypergeometric distribution.
iTail
[input] int,
TAILED_TEST_DISC_LOWER. lower tail. .
TAILED_TEST_DISC_UPPER. upper tail. .
TAILED_TEST_DISC_POINT. point probability. .
nFail
[output] on successful exit, it returns the NAG error code NE_NOERROR; if an error or warning has been detected, then it returns the specific error or warning code.

Return

Returns Hypergeometric distribution cdf

Examples

EX1

void hygecdf_ex1()
{
        double iK[]= {2, 5, 10};
        int m= 20, n=100, l=10;
        for(int ii = 0; ii<3; ii++)
                printf("%f:    %f\n", iK[ii], hygecdf(iK[ii],m,n,l));
}

Remark

See Also

header to Include

origin.h

Reference