SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

BNBPPF

Name:
    BNBPPF (LET)
Type:
    Library Function
Purpose:
    Compute the beta-negative binomial percent point function with shape parameters alpha and beta and k.
Description:
    If the probability of success parameter, p, of a negative binomial distribution has a Beta distribution with shape parameters alpha and beta, the resulting distribution is referred to as a beta-negative binomial distribution. For a standard negative binomial distribution, p is assumed to be fixed for successive trials. For the beta-negative binomial distribution, the value of p changes for each trial.

    The formula for the beta-negative binomial probability mass function is

      P(x;alpha,beta,k) = 
[Gamma(beta+alpha)*Gamma(k+beta)*Gamma(x+k)*Gamma(x+alpha)]/
[Gamma(k)*Gamma(beta)*Gamma(alpha)*Gamma(x+1)*Gamma(x+k_alpha+beta)]
x = 0, 1, 2, ...; alpha, beta > 0; k is a positive integer

    with alpha, beta, and k denoting the shape parameters and Gamma denoting the gamma function.

    Note that there are a number of different parameterizations and formulations of this distribution in the literature. We use the above formulation because it makes clear the relation between the beta-negative binomial and the negative binomial distributions. It also demonstrates the relation between the beta-negative binomial and the beta-binomial and beta-geometric distributions. It also provides a computationally convenient formula since the beta-negative binomial can be computed as the sums and differences of log gamma functions.

    Dataplot compumtes the cumulative distribution function using the following recurrence relation derived by Hesselager:

      p(x;alpha,beta,k) = p(x-1;alpha,beta,k)*[x+(k-1)]*[x+(alpha-1)]/
[x*(x+(alpha+beta+k-1))]

    Dataplot computes the percent point function by summing the cumulative distribution function until the specified probability is obtained.

Syntax:
    LET <y> = BNBPPF(<p>,<alpha>,<beta>,<k>)
                            <SUBSET/EXCEPT/FOR qualification>
    where <x> is a number, parameter, or variable in the interval (0,1);
                <alpha> is a number, parameter, or variable that specifies the first shape parameter;
                <beta> is a number, parameter, or variable that specifies the second shape parameter;
                <k> is a number, parameter, or variable that specifies the third shape parameter;
                <y> is a variable or a parameter (depending on what <p> is) where the computed beta-negative binomial ppf value is stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET A = BNBPPF(0.95,0.5,0.9,3)
    LET A = BNBPPF(P,2.1,4,2.5)
    PLOT BNBPPF(P,ALPHA,BETA,K) FOR P = 0 0.01 0.99
Note:
    This distribution is sometimes referred to as the inverse Markov-Polya (or inverse Polya-Eggenberger) distribution.

    Irwin developed the generalized Waring distribution based on a generalization of the Waring expansion. The generalized Waring distribution is a re-parameterized beta-negative binomial distribution. Irwin's uses the parameterization

      beta = a
      alpha = c - a
      k = k
Default:
    None
Synonyms:
    GWAPPF is a synonym for BNBPPF
Related Commands:
    BNBCDF = Compute the beta-negative binomial cumulative distribution function.
    BNBPDF = Compute the beta-negative binomial proability mass function.
    BGEPDF = Compute the beta-geomeric cumulative distribution function.
    BETPDF = Compute the beta probability density function.
    NBPDF = Compute the negative binomial probability mass function.
    BBNPDF = Compute the beta-binomial probability mass function.
Reference:
    Ole Hesselager (1994), "A Recursive Procedure for Calculations of Some Compound Distributions", Astin Bulliten, Vol. 24, No. 1, pp. 19-32.

    J. O. Irwin (1975), "The Generalized Waring Distribution Part 1", Journal of the Royal Statistical Society, Series A, 138, pp. 18-31.

    J. O. Irwin (1975), "The Generalized Waring Distribution Part 2", Journal of the Royal Statistical Society, Series A, 138, pp. 204-227.

    J. O. Irwin (1975), "The Generalized Waring Distribution Part 3", Journal of the Royal Statistical Society, Series A, 138, pp. 374-378.

    Johnson, Kotz, and Kemp (1992), "Univariate Discrete Distributions", Second Edition, Wiley, chapter 6.

    Luc Devroye (1992), "Random Variate Generation for the Digamma and Trigamma Distributions", Journal of Statistical Computation and Simulation", Vol. 43, pp. 197-216.

Applications:
    Distributional Modeling
Implementation Date:
    2006/7
Program:
     
    TITLE CASE ASIS
    LABEL CASE ASIS
    Y1LABEL Number of Successes
    X1LABEL Probability
    TITLE DISPLACEMENT 2
    Y1LABEL DISPLACEMENT 15
    X1LABEL DISPLACEMENT 12
    .
    MULTIPLOT 2 2
    MULTIPLOT CORNER COORDINATES 0 0 100 95
    MULTIPLOT SCALE FACTOR 2
    .
    LET K = 3
    TITLE Alpha = 0.5, Beta = 0.5, K = 3
    PLOT BNBPPF(P,0.5,0.5,K) FOR P = 0  0.01  0.99
    .
    TITLE Alpha = 3, Beta = 0.5, K = 3
    PLOT BNBPPF(P,3.0,0.5,K) FOR P = 0  0.01  0.99
    .
    TITLE Alpha = 0.5, Beta = 3, K = 3
    PLOT BNBPPF(P,0.5,3.0,K) FOR P = 0  0.01  0.99
    .
    TITLE Alpha = 3, Beta = 3, K = 3
    PLOT BNBPPF(P,3.0,3.0,K) FOR P = 0  0.01  0.99
    .
    END OF MULTIPLOT
    .
    CASE ASIS
    JUSTIFICATION CENTER
    MOVE 50 97
    TEXT Beta-Negative Binomial Percent Point Functions
        
    plot generated by sample program

Date created: 8/23/2006
Last updated: 8/23/2006
Please email comments on this WWW page to alan.heckert@nist.gov.