

   TThhee NNeeggaattiivvee BBiinnoommiiaall DDiissttrriibbuuttiioonn

        dnbinom(x, n, p)
        pnbinom(q, n, p)
        qnbinom(prob, n, p)
        rnbinom(nobs, n, p)

   DDeessccrriippttiioonn::

        These functions provide information about the negative
        binomial distribution with parameters `n' and `p'.
        `dnbinom' gives the density, `pnbinom' gives the dis-
        tribution function, `qnbinom' gives the quantile func-
        tion and `rnbinom' generates random deviates.

        The negative binomial distribution has density

                  p(x) = Choose(x+n-1,x) p^n (1-p)^x

        for x = 0, 1, 2, ...

   SSeeee AAllssoo::

        `dbinom' for the binomial and `dpois' for the Poisson
        distribution.

   EExxaammpplleess::

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

