Learn R Programming

mederrRank (version 0.1.0)

dnegbinom: The Negative Binomial Distribution

Description

Density function for the negative binomial distribution with parameters alpha and prob.

Usage

dnegbinom(x, alpha, prob, log.p = FALSE)

Value

dnegbinom gives the density corresponding to the alpha and prob values provided.

Arguments

x

vector of (non-negative integer) quantiles.

alpha

target for number of successful trials. Must be strictly positive, need not be integer.

prob

probability of success in each trial. 0 < prob <= 1.

log.p

logical; if TRUE, probabilities p are given as log(p).

Author

Sergio Venturini sergio.venturini@unicatt.it,

Jessica A. Myers jmyers6@partners.org

Details

The negative binomial distribution with parameters alpha = \(\alpha\) and prob = \(p\) has density $$\frac{\Gamma(x + \alpha)}{\Gamma(\alpha) x!} p^\alpha (1-p)^x$$ for \(x = 0,1,\ldots,\alpha > 0\) and \(0 < p \leq 1\). This represents the number of failures which occur in a sequence of Bernoulli trials before a target number of successes is reached.

References

DuMouchel W. (1999), "Bayesian Data Mining in Large Frequency Tables, with an Application to the FDA Spontaneous Reporting System". The American Statistician, 53, 177-190.

Myers, J. A., Venturini, S., Dominici, F. and Morlock, L. (2011), "Random Effects Models for Identifying the Most Harmful Medication Errors in a Large, Voluntary Reporting Database". Technical Report.

See Also

dmixnegbinom, dnbinom.