Negative binomial parameterization conversion

nb_param_convert(size = NULL, prob = NULL, mu = NULL)

Arguments

size

either the number of samples (probability-size parameterization) or the dispersion parameter (mean-dispersion parameterization)

prob

probability of success in each trial

mu

mean

Value

named vector providing alternative parameterization for use with stats::rnbinom and related functions.

Details

Converts between the mean-dispersion parameterization and the probability-size parameterization of the Negative Binomial. Supply either prob and size to get mu (mean) and size (dispersion), or mu and size to get prob and size.