# pymc.HyperGeometric#

class pymc.HyperGeometric(name, *args, **kwargs)[source]#

Discrete hypergeometric distribution.

The probability of $$x$$ successes in a sequence of $$n$$ bernoulli trials taken without replacement from a population of $$N$$ objects, containing $$k$$ good (or successful or Type I) objects. The pmf of this distribution is

$f(x \mid N, n, k) = \frac{\binom{k}{x}\binom{N-k}{n-x}}{\binom{N}{n}}$
 Support $$x \in \left[\max(0, n - N + k), \min(k, n)\right]$$ Mean $$\dfrac{nk}{N}$$ Variance $$\dfrac{(N-n)nk(N-k)}{(N-1)N^2}$$
Parameters
N

Total size of the population (N > 0)

k

Number of successful individuals in the population (0 <= k <= N)

n

Number of samples drawn from the population (0 <= n <= N)

Methods

 HyperGeometric.__init__(*args, **kwargs) HyperGeometric.dist(N, k, n, *args, **kwargs) Creates a tensor variable corresponding to the cls distribution. HyperGeometric.logcdf(good, bad, n) HyperGeometric.logp(good, bad, n) HyperGeometric.moment(size, good, bad, n)

Attributes

 rv_op