powered by
Sampler for the Conway-Maxwell-Poisson as described in Algorithm 2 - Benson & Friel (2021)
com_sampler(mu, nu, n = 1, ndraws = FALSE)
A list or numeric in case ndraws = FALSE:
Values sampled from the distribution
Number of draws required in the rejection sampler
Log of the boundary of the rejection sampler
Location parameter
Shape parameter
Number of draws (default = 1)
Optional: Return the number of draws required to generate the n samples.
com_sampler(2, 0.2, n = 10, ndraws = TRUE) com_sampler(1, 2)
Run the code above in your browser using DataLab