powered by
Calculates the PMF for the convolution of arbitrary negative binomial random variables.
dnbconv( counts, mus, ps, phis, method = c("exact", "moments", "saddlepoint"), n.terms = 1000, n.cores = 1, tolerance = 0.001, normalize = TRUE )
A numeric vector of probability densities.
The counts over which the convolution is evaluated. Should be a vector.
Vector of individual mean values
Vector of individual probabilities of success.
Vector of individual dispersion parameters. Equivalent to 'size' in dnbinom.
The method by which to evaluate the PMF. One of "exact", "moments", or "saddlepoint".
The number of terms to include in the series for evaluating the PMF at a given number of counts. Defaults to 1000.
The number of CPU cores to use in the evaluation. Allows parallelization.
The acceptable difference between the sum of the K distribution and 1.
Boolean. If TRUE, the PMF is normalized to sum to 1.
dnbconv(counts = 0:500, mus = c(100, 10), phis = c(5, 8), method = "exact")
Run the code above in your browser using DataLab