Fisher's noncentral hypergeometric distribution explained

In probability theory and statistics, Fisher's noncentral hypergeometric distribution is a generalization of the hypergeometric distribution where sampling probabilities are modified by weight factors. It can also be defined as the conditional distribution of two or more binomially distributed variables dependent upon their fixed sum.

The distribution may be illustrated by the following urn model. 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 balls randomly in such a way that the probability of taking a particular ball is proportional to its weight, but independent of what happens to the other balls. The number of balls taken of a particular color follows the binomial distribution. If the total number n of balls taken is known then the conditional distribution of the number of taken red balls for given n is Fisher's noncentral hypergeometric distribution. To generate this distribution experimentally, we have to repeat the experiment until it happens to give n balls.

If we want to fix the value of n prior to the experiment then we have to take the balls one by one until we have n balls. The balls are therefore no longer independent. This gives a slightly different distribution known as Wallenius' noncentral hypergeometric distribution. It is far from obvious why these two distributions are different. See the entry for noncentral hypergeometric distributions for an explanation of the difference between these two distributions and a discussion of which distribution to use in various situations.

The two distributions are both equal to the (central) hypergeometric distribution when the odds ratio is 1.

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.

Fisher's noncentral hypergeometric distribution was first given the name extended hypergeometric distribution (Harkness, 1965), and some authors still use this name today.

Univariate distribution

The probability function, mean and variance are given in the adjacent table.

An alternative expression of the distribution has both the number of balls taken of each color and the number of balls not taken as random variables, whereby the expression for the probability becomes symmetric.

The calculation time for the probability function can be high when the sum in P0 has many terms. The calculation time can be reduced by calculating the terms in the sum recursively relative to the term for y = x and ignoring negligible terms in the tails (Liao and Rosen, 2001).

The mean can be approximated by:

\mu

-2c
b-\sqrt{b2-4ac
} \,,where

a=\omega-1

,

b=m1+n-N-(m1+n)\omega

,

c=m1n\omega

.

The variance can be approximated by:

\sigma2

N
N-1

/\left(

1
\mu

+

1
m1-\mu

+

1
n-\mu

+

1
\mu+m2-n

\right)

.

Better approximations to the mean and variance are given by Levin (1984, 1990), McCullagh and Nelder (1989), Liao (1992), and Eisinga and Pelzer (2011). The saddlepoint methods to approximate the mean and the variance suggested Eisinga and Pelzer (2011) offer extremely accurate results.

Properties

The following symmetry relations apply:

\operatorname{fnchypg}(x;n,m1,N,\omega)=\operatorname{fnchypg}(n-x;n,m2,N,1/\omega).

\operatorname{fnchypg}(x;n,m1,N,\omega)=\operatorname{fnchypg}(x;m1,n,N,\omega).

\operatorname{fnchypg}(x;n,m1,N,\omega)=\operatorname{fnchypg}(m1-x;N-n,m1,N,1/\omega).

Recurrence relation:

\operatorname{fnchypg}(x;n,m1,N,\omega)=\operatorname{fnchypg}(x-1;n,m1,N,\omega)

(m1-x+1)(n-x+1)
x(m2-n+x)

\omega.

The distribution is affectionately called "finchy-pig," based on the abbreviation convention above.

Derivation

The univariate noncentral hypergeometric distribution may be derived alternatively as a conditional distribution in the context of two binomially distributed random variables, for example when considering the response to a particular treatment in two different groups of patients participating in a clinical trial. An important application of the noncentral hypergeometric distribution in this context is the computation of exact confidence intervals for the odds ratio comparing treatment response between the two groups.

Suppose X and Y are binomially distributed random variables counting the number of responders in two corresponding groups of size mX and mY respectively,

X\sim\operatorname{Bin}(mX,\piX),Y\sim\operatorname{Bin}(mY,\piY)

.Their odds ratio is given as

\omega=

\omegaX
\omegaY

=

\piX/(1-\piX)
\piY/(1-\piY)

.The responder prevalence

\pii

is fully defined in terms of the odds

\omegai

,

i\in\{X,Y\}

, which correspond to the sampling bias in the urn scheme above, i.e.

\pii=

\omegai
1+\omegai
.

The trial can be summarized and analyzed in terms of the following contingency table.

responder non-responder Total
Xx . mX
Yy . mY
Totaln . N
In the table,

n=x+y

corresponds to the total number of responders across groups, and N to the total number of patients recruited into the trial. The dots denote corresponding frequency counts of no further relevance.

The sampling distribution of responders in group X conditional upon the trial outcome and prevalences,

Pr(X=x|X+Y=n,mX,mY,\omegaX,\omegaY)

, is noncentral hypergeometric:

\begin{align} F(X,\omega):&=Pr(X=x|X+Y=n,mX,mY,\omegaX,\omegaY)\\ &=

Pr(X=x,X+Y=n|mX,mY,\omegaX,\omegaY)
Pr(X+Y=n|mX,mY,\omegaX,\omegaY)

\\ &=

Pr(X=x|mX,\omegaX)Pr(Y=n-x|mY,\omegaY,X=x)
Pr(X+Y=n|mX,mY,\omegaX,\omegaY)

\\ &=

\binom{mX
x
mX-x
\pi
X)

\binom{mY}{n-x}\pi

n-x
Y
mY-(n-x)
(1-\pi
Y)
}\\&= \frac\\&= \frac\\&= \frac\end

Note that the denominator is essentially just the numerator, summed over all events of the joint sample space

(X,Y)

for which it holds that

X+Y=n

. Terms independent of X can be factored out of the sum and cancel out with the numerator.

Multivariate distribution

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 function and a simple approximation to the mean are given to the right. Better approximations to the mean and variance are given by McCullagh and Nelder (1989).

Properties

The order of the colors is arbitrary so that any colors can be swapped.

The weights can be arbitrarily scaled:

\operatorname{mfnchypg}(x;n,m,\boldsymbol{\omega})=\operatorname{mfnchypg}(x;n,m,r\boldsymbol{\omega})

for all

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:

\begin{align} &{}\operatorname{mfnchypg}\left(x;n,m,(\omega1,\ldots,\omegac-1,\omegac-1)\right)\\ &{}=\operatorname{mfnchypg}\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) \end{align}

where

\operatorname{hypg}(x;n,m,N)

is the (univariate, central) hypergeometric distribution probability.

Applications

Fisher's noncentral hypergeometric distribution is useful for models of biased sampling or biased selection where the individual items are sampled independently of each other with no competition. The bias or odds can be estimated from an experimental value of the mean. Use Wallenius' noncentral hypergeometric distribution instead if items are sampled one by one with competition.

Fisher's noncentral hypergeometric distribution is used mostly for tests in contingency tables where a conditional distribution for fixed margins is desired. This can be useful, for example, for testing or measuring the effect of a medicine. See McCullagh and Nelder (1989).

Software available

See also

References

.

.

.

.

.

.

.

.

.

.