rnb | R Documentation |
This function generates random samples from a negative binomial distribution with the specified dispersion parameter (r
) and success probability (p
).
rnb(r, p)
r |
The number of failures before achieving a specified number of successes in a negative binomial experiment. It also serves as the dispersion parameter which controls the variance of the distribution. |
p |
The probability of success on each independent Bernoulli trial within the negative binomial experiment. |
A random value sampled from the negative binomial distribution with parameters r
and p
.
r <- 2
p <- 0.3
rnb(r, p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.