Learn R Programming

compoisson (version 0.3)

dcom: The COM-Poisson Distribution

Description

Probability mass function and random generation for the COM-Poisson distribution for given values of the parameters.

Usage

dcom(x, lambda, nu, z = NULL) rcom(n, lambda, nu, log.z = NULL)

Arguments

x
level to evaluate the PMF at
lambda
value of lambda parameter
nu
value of nu parameter
z
normalizing constant, computed if not specified
n
number of random values to return
log.z
natural log of z

Value

dcom gives the probability that a random COM-Poisson variable X takes value x. rcom gives a vector of n random values sampled from the COM-Poisson distribution.

Details

Computes the probability mass function of the COM-Poisson distribution $$ f(x) = \frac{1}{Z(\lambda,\nu)}\frac{\lambda^x}{(x!)^\nu}. $$

References

Shmueli, G., Minka, T. P., Kadane, J. B., Borle, S. and Boatwright, P., “A useful distribution for fitting discrete data: Revival of the Conway-Maxwell-Poisson distribution,” J. Royal Statist. Soc., v54, pp. 127-142, 2005.

See Also

com.loglikelihood, com.log.density

Examples

Run this code
	data(insurance);
	fit = com.fit(Lemaire);
	dcom(0, fit$lambda, fit$nu, fit$z);
	r = rcom(10, fit$lambda, fit$nu);

Run the code above in your browser using DataLab