hygequant

The hygequant function calculates the hypergeometric quantile.

Synopsis

hygequant(p,m,n,k,lower_tail)

Summary

The hypergeometric probability mass function has the following parameters:

  • p probability between 0 and 1 (inclusive).

  • m number of white marbles in the jar.

  • n number of black marbles in the jar.

  • k number of marbles drawn from the jar.

  • lower_tail, set to TRUE for the lower-tail quantile, FALSE for the upper-tail quantile.

Examples

To show the hypergeometric qualtile function, create and populate the array, then calculate the hypergeometric quantile function, all within a single AFL statement:

AFL% apply(
       apply(build(<x:double>[i=0:0], 0.45),
            m, 12,
            n, 18,
            k, 17),
        quant, hygequant(x,m,n,k,false));
{i} x,m,n,k,quant
{0} 0.45,12,18,17,7

 

Â