

   SSiimmuullaattee NNeeggaattiivvee BBiinnoommiiaall VVaarriiaatteess

        rnegbin(n, mu=n, theta=stop("theta must be given"))

   AArrgguummeennttss::

          n: If a scalar, the number of sample values required.
             If a vector, `length(n)' is the number required
             and `n' is used as the mean vector if `mu' is not
             specified.

         mu: The vector of means.  Short vectors are recycled.

      theta: Vector of values of the `theta' parameter.  Short
             vectors are recycled.

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

        Function to generate random outcomes from a Negative
        Binomial distribution, with mean `mu' and variance `mu
        + mu^2/theta'.

   DDeettaaiillss::

        The function uses the representation of the Negative
        Binomial distribution as a continuous mixture of Pois-
        son distributions with Gamma distributed means.  Unlike
        `rnbinom' the index can be arbitrary.

   VVaalluuee::

        Vector of random Negative Binomial variate values.

   SSiiddee EEffffeeccttss::

        Changes `.Random.seed' in the usual way.

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

        # Negative Binomials with means fitted(fm) and theta=4.5
        data(quine)
        fm <- glm.nb(Days ~ ., data=quine)
        dummy <- rnegbin(fitted(fm), theta=4.5)

