Sample variables from a negative binomial distribution with fixed sum
Source:R/sampling.R
sample_negbinom.Rd
This function samples from a negative binomial distribution. Rather than
specifying the total number of samples, as with rnbinom
, this function
takes as input an integer N
which the resulting samples must sum to. This
is achieved by adjusting the final sample. As such, the resulting samples
are not strictly speaking from a negative binomial distribution.
See also
Other sampling:
sample_log_normal()
,
sample_offset_truncated_power_distribution()