CompGLM (version 2.0)

rcomp: 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 \(\lambda\).

nu

a double of the parameter \(\nu\).

sumTo

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

Value

A random sample of size n.

Details

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

Examples

Run this code
# NOT RUN {
require(graphics)
sample <- rcomp(1000, 8.5, 0.9)
barplot(table(sample))
# }

Run the code above in your browser using DataLab