powered by
Implements Furman's exact PMF for the evaluation of the sum of arbitrary NB random variables. Called by other functions. Not intended to be run alone.
nb_sum_exact(phis, ps, n.terms = 1000, counts, n.cores = 1, tolerance = 0.001)
A numeric vector of probability densities.
Vector of individual dispersion parameters. Equivalent to 'size' in dnbinom.
Vector of individual probabilities of success.
The number of terms to include in the series for evaluating the PMF at a given number of counts. Defaults to 1000.
The vector of counts over which the PMF is evaluated.
The number of CPU cores to use in the evaluation. Allows parallelization.
The acceptable difference between the sum of the K distribution and 1.
nb_sum_exact(ps = c(0.05, 0.44), phis = c(5, 8), counts = 0:500)
Run the code above in your browser using DataLab