rnb: Generate Random Samples from a Negative Binomial Distribution

View source: R/RcppExports.R

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

linelistBayes documentation built on May 29, 2024, 3:50 a.m.