<< geometric Distribution Functions lognormal >>

sci_gsl >> sci_gsl > Distribution Functions > hypergeom

hypergeom

Hypergeometric Distribution

Syntax

y = hypergeom(n1,n2,t,k,c)

Parameters

y:

output

n1:

number of elements of type-1 in the population

n2:

number of elements of type-2 in the population

t:

number of samples and t<=(n1+n2)

k:

number of elements of type-1 in t samples. The domain of k is max(0,t-n2)....,min(t,n1).

c = 1:

It will allow the user to generate a hypergeometric random variate. In this case the function is independent of k and hence any value of k can be set.

c = 2:

It will allow the user to compute the probability p(k) of obtaining k from a hypergeometric distribution with parameters n1, n2, t.

c = 3:

It will allow the user to compute hypergeometric cdf P(k)

c =>4:

It will allow the user to compute hypergeometric cdf Q(k)

Description

This function is used to calculate hypergeometric random variate, probability p(k) of obtaining k from a hypergeometric distribution and cumulative distribution functions P(k), Q(k).

Examples

// probability p(k) of obtaining k=1 from hypergeometric distribution with n1=5, n2=20 and t=3
n1=5
n2=20
t=3
k=1
c=2
y = hypergeom(n1,n2,t,k,c)
disp(y)

Authors


Report an issue
<< geometric Distribution Functions lognormal >>