TITLE(NegBinomial @@ The Negative Binomial Distribution)
USAGE(
dnbinom(x, n, p)
pnbinom(q, n, p)
qnbinom(prob, n, p)
rnbinom(nobs, n, p)
)
ALIAS(dnbinom)
ALIAS(pnbinom)
ALIAS(qnbinom)
ALIAS(rnbinom)
DESCRIPTION(
These functions provide information about the negative binomial
distribution with parameters LANG(n) and LANG(p).  LANG(dnbinom)
gives the density, LANG(pnbinom) gives the distribution function
LANG(qnbinom) gives the quantile function and LANG(rnbinom) generates
random deviates.
PARA
The negative binomial distribution has density
DEQN(
p(x) = CHOOSE(x+n-1@@x) SUP(p@@n) SUP((1-p)@@x)
@@
p(x) = Choose(x+n-1,x) p^n (1-p)^x
)
for EQN(x = 0, 1, 2, LDOTS)
)
SEEALSO(
LANG(LINK(dbinom)) for the binomial and LANG(LINK(dpoisson)) for the
Poisson distribution.
)
EXAMPLES(
x <- 0:11
dnbinom(x, n = 1, p = 1/2) * 2^(1 + x) # == 1
126 /  dnbinom(0:8, n = 2, p = 1/2) #- theoretically integer
## Cumulative ('p') = Sum of discrete prob.s ('d');  Relative error 
summary(1 - cumsum(dnbinom(x, n=2, p= 1/2)) / pnbinom(x, n=2, p= 1/2))
)
KEYWORD(distribution)
