Documentation

hygestat

Hypergeometric mean and variance

Syntax

[MN,V] = hygestat(M,K,N)

Description

[MN,V] = hygestat(M,K,N)returns the mean of and variance for the hypergeometric distribution with corresponding size of the population,M, number of items with the desired characteristic in the population,K, and number of samples drawn,N. Vector or matrix inputs forM,K, andNmust have the same size, which is also the size ofMNandV. A scalar input forM,K, orNis expanded to a constant matrix with the same dimensions as the other inputs.

The mean of the hypergeometric distribution with parametersM,K, andNisNK/M, and the variance isNK(M-K)(M-N)/[M^2(M-1)].

Examples

The hypergeometric distribution approaches the binomial distribution, wherep = K/M, asMgoes to infinity.

[m,v] = hygestat(10.^(1:4),10.^(0:3),9) m = 0.9000 0.9000 0.9000 0.9000 v = 0.0900 0.7445 0.8035 0.8094 [m,v] = binostat(9,0.1) m = 0.9000 v = 0.8100

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a

Was this topic helpful?