com_sampler: Rejection Sampler - COM-Poisson

View source: R/com_sampler.R

com_samplerR Documentation

Rejection Sampler - COM-Poisson

Description

Sampler for the Conway-Maxwell-Poisson as described in Algorithm 2 - Benson & Friel (2021)

Usage

com_sampler(mu, nu, n = 1, ndraws = FALSE)

Arguments

mu

Location parameter

nu

Shape parameter

n

Number of draws (default = 1)

ndraws

Optional: Return the number of draws required to generate the n samples.

Value

A list or numeric in case ndraws = FALSE:

sample

Values sampled from the distribution

drawsa

Number of draws required in the rejection sampler

log_Bf

Log of the boundary of the rejection sampler

Examples

com_sampler(2, 0.2, n = 10, ndraws = TRUE)
com_sampler(1, 2)

MultRegCMP documentation built on June 22, 2024, 9:47 a.m.