rnegbin {MASS}
Description
Function to generate random outcomes from a Negative Binomial distribution, with mean mu and variance mu + mu^2/theta.
Usage
rnegbin(n, mu = n, theta = stop("'theta' must be specified"))
Arguments
- n
- If a scalar, the number of sample values required. If a vector,
length(n)is the number required andnis used as the mean vector ifmuis not specified. - mu
- The vector of means. Short vectors are recycled.
- theta
- Vector of values of the
thetaparameter. Short vectors are recycled.
Details
The function uses the representation of the Negative Binomial distribution as a continuous mixture of Poisson distributions with Gamma distributed means. Unlike rnbinom the index can be arbitrary.
Values
Vector of random Negative Binomial variate values.
Side Effects
Changes .Random.seed in the usual way.
Examples
Documentation reproduced from package MASS, version 7.3-17. License: GPL-2 | GPL-3
