hygeinv
statistics: x = hygeinv (p, m, k, n)
Inverse of the hypergeometric cumulative distribution function (iCDF).
For each element of p, compute the quantile (the inverse of the CDF) of the hypergeometric distribution with parameters m, k, and n. The size of x is the common size of p, m, k, and n. A scalar input functions as a constant matrix of the same size as the other inputs.
This is the number of drawn marked items x given a probability p,
when randomly drawing a sample of size n without replacement from a
population of total size m containing k marked items. The
parameters m, k, and n must be non-negative integers with
k and n not greater than m, and m finite unless
n is 0.
For p = 0 and p = 1, x is the least and the greatest
number of marked items the sample can hold, max (0, n - (m
- k)) and min (n, k). MATLAB does not return for
p = 0.
Further information about the hypergeometric distribution can be found at https://en.wikipedia.org/wiki/Hypergeometric_distribution
Input arguments must be double or single; integer, logical,
and character arrays are rejected. MATLAB accepts a character array and
evaluates it at the character codes, which Octave deliberately does not,
since a character array is an integer type and integers are refused too.
See also: hygecdf, hygepdf, hygernd, hygestat
Source Code: hygeinv
Plot various iCDFs from the hypergeometric distribution
p = 0.001:0.001:0.999;
x1 = hygeinv (p, 500, 50, 100);
x2 = hygeinv (p, 500, 60, 200);
x3 = hygeinv (p, 500, 70, 300);
plot (p, x1, '-b', p, x2, '-g', p, x3, '-r')
grid on
ylim ([0, 60])
legend ({'m = 500, k = 50, n = 100', 'm = 500, k = 60, n = 200', ...
'm = 500, k = 70, n = 300'}, 'location', 'northwest')
title ('Hypergeometric iCDF')
xlabel ('probability')
ylabel ('values in p (number of successes)')