GNOME Bugzilla – Bug 703164
r.?nbinom documentation problem
Last modified: 2013-06-28 04:23:20 UTC
The documentation currently says: --------------------------------------- R.PNBINOM: cumulative distribution function of the negative binomial distribution Arguments: x: observation n: the number of trials psuc: the probability of success in each trial lower_tail: if true (the default), the lower tail of the distribution is considered log_p: if true, log of the probability is used --------------------------------------- Since the number of trials for the negative binomial distribution is not fixed (in fact the random variable x is the number of trials), n is not correct. In the R documentation we have: ---------------------------------------------------------- Usage dnbinom(x, size, prob, mu, log = FALSE) pnbinom(q, size, prob, mu, lower.tail = TRUE, log.p = FALSE) qnbinom(p, size, prob, mu, lower.tail = TRUE, log.p = FALSE) rnbinom(n, size, prob, mu) Arguments x vector of (non-negative integer) quantiles. q vector of quantiles. p vector of probabilities. n number of observations. If length(n) > 1, the length is taken to be the number required. size target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer. prob probability of success in each trial. 0 < prob <= 1. mu alternative parametrization via mean: see ‘Details’. log, log.p logical; if TRUE, probabilities p are given as log(p). lower.tail logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x]. ---------------------------------------------------------- I suspect we should have: n: target for number of successful trials
or we could say: n: required number of successful trials Note that this is somewhat strange since I belive it is more common to define the negative binomial distribution as "In probability theory and statistics, the negative binomial distribution is a discrete probability distribution of the number of successes in a sequence of Bernoulli trials before a specified (non-random) number of failures (denoted r) occurs." (from wikipedia)
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.