rnb {linelistBayes} | R Documentation |
Generate Random Samples from a Negative Binomial Distribution
Description
This function generates random samples from a negative binomial distribution with the specified dispersion parameter (r
) and success probability (p
).
Usage
rnb(r, p)
Arguments
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. |
Value
A random value sampled from the negative binomial distribution with parameters r
and p
.
Examples
r <- 2
p <- 0.3
rnb(r, p)
[Package linelistBayes version 1.0 Index]