Dataplot Vol 2 Vol 1

# BNBCDF

Name:
BNBCDF (LET)
Type:
Library Function
Purpose:
Compute the beta-negative binomial cumulative distribution function with shape parameters and and k.
Description:
If the probability of success parameter, p, of a negative binomial distribution has a Beta distribution with shape parameters and , 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

with , , and k denoting the shape parameters and 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:

Syntax:
LET <y> = BNBCDF(<x>,<alpha>,<beta>,<k>)
<SUBSET/EXCEPT/FOR qualification>
where <x> is a number, parameter, or variable containing non-negative integer values;
<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 <x> is) where the computed beta-negative binomial cdf value is stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET A = BNBCDF(4,0.5,0.9,3)
LET A = BNBCDF(X,2.1,4,2.5)
PLOT BNBCDF(X,ALPHA,BETA,K) FOR X = 0 1 20
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

= a
= c - a
k = k
Default:
None
Synonyms:
GWACDF is a synonym for BNBCDF
Related Commands:
 BNBPDF = Compute the beta-negative binomial probability mass function. BNBPPF = Compute the beta-negative binomial percent point 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:
```
XLIMITS 0 50
XTIC OFFSET 0.5 0.5
LINE BLANK
SPIKE ON
SPIKE THICKNESS 0.3
.
TITLE CASE ASIS
LABEL CASE ASIS
X1LABEL Number of Successes
Y1LABEL 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 BNBCDF(X,0.5,0.5,K) FOR X = 0 1 50
.
TITLE Alpha = 3, Beta = 0.5, K = 3
PLOT BNBCDF(X,3.0,0.5,K) FOR X = 0 1 50
.
TITLE Alpha = 0.5, Beta = 3, K = 3
PLOT BNBCDF(X,0.5,3.0,K) FOR X = 0 1 50
.
TITLE Alpha = 3, Beta = 3, K = 3
PLOT BNBCDF(X,3.0,3.0,K) FOR X = 0 1 50
.
END OF MULTIPLOT
.
CASE ASIS
JUSTIFICATION CENTER
MOVE 50 97
TEXT Beta-Negative Binomial Cumulative Distribution Functions
```

Date created: 8/23/2006
Last updated: 8/23/2006