In probability theory and statistics, Wallenius' noncentral hypergeometric distribution (named after Kenneth Ted Wallenius) is a generalization of the hypergeometric distribution where items are sampled with bias.
This distribution can be illustrated as an urn model with bias. Assume, for example, that an urn contains m1 red balls and m2 white balls, totalling N = m1 + m2 balls. Each red ball has the weight ω1 and each white ball has the weight ω2. We will say that the odds ratio is ω = ω1 / ω2. Now we are taking n balls, one by one, in such a way that the probability of taking a particular ball at a particular draw is equal to its proportion of the total weight of all balls that lie in the urn at that moment. The number of red balls x1 that we get in this experiment is a random variable with Wallenius' noncentral hypergeometric distribution.
The matter is complicated by the fact that there is more than one noncentral hypergeometric distribution. Wallenius' noncentral hypergeometric distribution is obtained if balls are sampled one by one in such a way that there is competition between the balls. Fisher's noncentral hypergeometric distribution is obtained if the balls are sampled simultaneously or independently of each other. Unfortunately, both distributions are known in the literature as "the" noncentral hypergeometric distribution. It is important to be specific about which distribution is meant when using this name.
The two distributions are both equal to the (central) hypergeometric distribution when the odds ratio is 1.
The difference between these two probability distributions is subtle. See the Wikipedia entry on noncentral hypergeometric distributions for a more detailed explanation.
Wallenius' distribution is particularly complicated because each ball has a probability of being taken that depends not only on its weight, but also on the total weight of its competitors. And the weight of the competing balls depends on the outcomes of all preceding draws.
This recursive dependency gives rise to a difference equation with a solution that is given in open form by the integral in the expression of the probability mass function in the table above.
Closed form expressions for the probability mass function exist (Lyons, 1980), but they are not very useful for practical calculations because of extreme numerical instability, except in degenerate cases.
Several other calculation methods are used, including recursion, Taylor expansion and numerical integration (Fog, 2007, 2008).
The most reliable calculation method is recursive calculation of f(x,n) from f(x,n-1) and f(x-1,n-1) using the recursion formula given below under properties. The probabilities of all (x,n) combinations on all possible trajectories leading to the desired point are calculated, starting with f(0,0) = 1 as shown on the figure to the right. The total number of probabilities to calculate is n(x+1)-x2. Other calculation methods must be used when n and x are so big that this method is too inefficient.
The probability that all balls have the same color is easier to calculate. See the formula below under multivariate distribution.
No exact formula for the mean is known (short of complete enumeration of all probabilities). The equation given above is reasonably accurate. This equation can be solved for μ by Newton-Raphson iteration. The same equation can be used for estimating the odds from an experimentally obtained value of the mean.
Wallenius' distribution has fewer symmetry relations than Fisher's noncentral hypergeometric distribution has. The only symmetry relates to the swapping of colors:
\operatorname{wnchypg}(x;n,m1,m2,\omega)=\operatorname{wnchypg}(n-x;n,m2,m1,1/\omega).
The following recursion formula is useful for calculating probabilities:
\operatorname{wnchypg}(x;n,m1,m2,\omega)=
\operatorname{wnchypg}(x-1;n-1,m1,m2,\omega)
(m1-x+1)\omega | |
(m1-x+1)\omega+m2+x-n |
+
\operatorname{wnchypg}(x;n-1,m1,m2,\omega)
m2+x-n+1 | |
(m1-x)\omega+m2+x-n+1 |
Another recursion formula is also known:
\operatorname{wnchypg}(x;n,m1,m2,\omega)=
\operatorname{wnchypg}(x-1;n-1,m1-1,m2,\omega)
m1\omega | |
m1\omega+m2 |
+
\operatorname{wnchypg}(x;n-1,m1,m2-1,\omega)
m2 | |
m1\omega+m2 |
.
The probability is limited by
\operatorname{f}1(x)\le\operatorname{wnchypg}(x;n,m1,m2,\omega)\le\operatorname{f}2(x),for\omega<1,
\operatorname{f}1(x)\ge\operatorname{wnchypg}(x;n,m1,m2,\omega)\ge\operatorname{f}2(x),for\omega>1,where
\operatorname{f}1(x)=\binom{m1}{x}\binom{m2}{n-x}
n! | ||||||||||||
|
(m2+\omega(m
\underline{n-x | |
1-x)) |
\operatorname{f}2(x)=\binom{m1}{x}\binom{m2}{n-x}
n! | ||||||||||||
|
(m2+\omega
\underline{n-x | |
m | |
1) |
a\underline{b
The distribution can be expanded to any number of colors c of balls in the urn. The multivariate distribution is used when there are more than two colors.
The probability mass function can be calculated by various Taylor expansion methods or by numerical integration (Fog, 2008).
The probability that all balls have the same color, j, can be calculated as:
\operatorname{mwnchypg}((0,\ldots,0,xj,0,\ldots);n,m,\boldsymbol{\omega})=
| |||||||
A reasonably good approximation to the mean can be calculated using the equation given above. The equation can be solved by defining θ so that
\mui=
\omegai\theta | |
m | |
i(1-e |
)
c | |
\sum | |
i=1 |
\mui=n
The equation for the mean is also useful for estimating the odds from experimentally obtained values for the mean.
No good way of calculating the variance is known. The best known method is to approximate the multivariate Wallenius distribution by a multivariate Fisher's noncentral hypergeometric distribution with the same mean, and insert the mean as calculated above in the approximate formula for the variance of the latter distribution.
The order of the colors is arbitrary so that any colors can be swapped.
The weights can be arbitrarily scaled:
\operatorname{mwnchypg}(x;n,m,\boldsymbol{\omega})=\operatorname{mwnchypg}(x;n,m,r\boldsymbol{\omega})
r\inR+
Colors with zero number (mi = 0) or zero weight (ωi = 0) can be omitted from the equations.
Colors with the same weight can be joined:
\operatorname{mwnchypg}\left(x;n,m,(\omega1,\ldots,\omegac-1,\omegac-1)\right)=
\operatorname{mwnchypg}\left((x1,\ldots,xc-1+xc);n,(m1,\ldots,mc-1+mc),(\omega1,\ldots,\omegac-1)\right) ⋅
\operatorname{hypg}(xc;xc-1+xc,mc,mc-1+mc),
\operatorname{hypg}(x;n,m,N)
The balls that are not taken in the urn experiment have a distribution that is different from Wallenius' noncentral hypergeometric distribution, due to a lack of symmetry. The distribution of the balls not taken can be called the complementary Wallenius' noncentral hypergeometric distribution.
Probabilities in the complementary distribution are calculated from Wallenius' distribution by replacing n with N-n, xi with mi - xi, and ωi with 1/ωi.