rcomp {CompGLM}R Documentation

Conway-Maxwell-Poisson Random Sample

Description

Provides a size n sample from the Conway-Maxwell-Poisson distribution with parameters lam and nu. Sampling is done via a simple multinomial approach.

Usage

rcomp(n, lam, nu, sumTo = 100L)

Arguments

n

an integer of the number of random samples to be taken.

lam

a double of the parameter λ.

nu

a double of the parameter ν.

sumTo

an integer for the summation term in the density (default 100).

Details

The function is only implemented for single values of lam and nu. See dcomp for details of the PDF.

Value

A random sample of size n.

Author(s)

Jeffrey Pollock <jeffpollock9@gmail.com>

Examples

require(graphics)
sample <- rcomp(1000, 8.5, 0.9)
barplot(table(sample))

[Package CompGLM version 2.0 Index]