dnegbinom: The Negative Binomial Distribution

View source: R/mederrRank.R

dnegbinomR Documentation

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)

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).

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.

Value

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

Author(s)

Sergio Venturini sergio.venturini@unicatt.it,

Jessica A. Myers jmyers6@partners.org

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.


sergioventurini/mederrRank documentation built on Oct. 19, 2023, 12:40 a.m.