WNChygeinv

WNChygeinv computes the inverse of the Wallenius non central hypergeometric cumulative distribution function (cdf)

Syntax

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

Description

example

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

Examples

expand all

  • Compute the inverse of Wallenius 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=WNChygeinv(0.3,M,K,n,odds);
    disp(x030)

    Related Examples

    expand all

  • Compute quantiles from inverse of Wallenius non central hypergeometric distribution.
  • M = total number of balls

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

    Input Arguments

    expand all

    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

    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

    Output Arguments

    expand all

    x —Wallenius' 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.

    This page has been automatically generated by our routine publishFS