# FNChygeinv

FNChygeinv computes the inverse of the Fisher non central hypergeometric cumulative distribution function (cdf)

## Syntax

• x=FNChygeinv(p,M,K,n,odds)example
• x=FNChygeinv(p,M,K,n,odds, accuracy)example

## Description

 x =FNChygeinv(p, M, K, n, odds) Compute the inverse of Fisher non central hypergeometric distribution.

 x =FNChygeinv(p, M, K, n, odds, accuracy) Compute quantiles 0.1, 0.2, ..., 0.9 from nverse of Fisher non central hypergeometric distribution.

## Examples

expand all

### Compute the inverse of Fisher non central hypergeometric distribution.

. M=80; total number of balls n=10; number of balls taken odds=3; Prob. of red balls vs other color balls K=50; Number of red balls in the urn Compute quantile 0.3

x030=FNChygeinv(0.3,M,K,n,odds);
disp(x030)

### Compute quantiles 0.1, 0.2, ..., 0.9 from nverse of Fisher non central hypergeometric distribution.

. M= total number of balls

M=80;
% n= number of balls taken
n=10;
% odds = Ratio of Prob. of red balls vs other color balls
odds=3;
% K = number of red balls in the urn
K=50;
% Compute quantiles 0.1, ..., 0.9
xquant=FNChygeinv(0.1:0.1:0.9,M,K,n,odds);
disp(xquant)
     7     7     8     8     8     9     9     9    10



## Input Arguments

### p — input probabilitiies. Scalar or vector or matrix.

You can think of p as the probability of observing x defective items (red balls) in n drawings without replacement from a group of M items where K are defective (the total numnber of red balls is K) and the ratio of the probability of observing a defect with that of observing a non defect is equal to odds.

Data Types:  single|double

### M — Total number of balls in urn before sampling. Scalar.

Data Types: single|double

### K — Initial number of red balls in the urn. Scalar.

Data Types: single|double

### n — Total number of balls sampled. Scalar.

Data Types: single|double

### odds — Probability ratio of red over white balls. Scalar.

Data Types: single|double

### accuracy — accuracy of the calculations. Scalar.

The default value of accuracy is 1e-08.

Example: 1e-06 

Data Types: single|double

## Output Arguments

### x —Fisher' quantile values. Quantiles corresponding to input probabilities

The size of x is the common size of the input arguments. A scalar input functions as a constant matrix of the same size as the other inputs.

## References

Fog, A. (2008), Calculation Methods for Wallenius' Noncentral Hypergeometric Distribution, "Communications in Statistics - Simulation and Computation", Vol. 37, pp. 258-273.