dcomp: Conway-Maxwell-Poisson Probability Density Function

Description Usage Arguments Details Value Author(s) Examples

View source: R/RcppExports.R

Description

The PDF of the Conway-Maxwell-Poisson distribution with parameters lam and nu at point y.

Usage

1
dcomp(y, lam, nu, sumTo = 100L, logP = FALSE)

Arguments

y

an integer vector where the density is to be calculated. If the input is not an integer, it will be coerced to be an integer.

lam

a double vector of the parameter λ.

nu

a double vector of the parameter ν.

sumTo

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

logP

a boolean for if the log of the density should be given (default FALSE).

Details

The Conway-Maxwell-Poisson distribution has density:

P(y) = λ^y / ((y!)^ν Z(λ, ν))

for y = 0, 1, 2, …, and:

Z(λ, ν) = ∑ λ^j / ((j!)^ν)

where the summation is approximated by summing from j = 0 to sumTo.

Value

The value of the PDF (or log PDF if logP = TRUE). Input vectors are recycled to be same length.

Author(s)

Jeffrey Pollock <jeffpollock9@gmail.com>

Examples

1
2
3
4
5
6
7
dcomp(-5:5, 2.5, 1)
dcomp(2, 2.5, 1.5)
require(graphics)
require(stats)
comp <- dcomp(0:10, 2.5, 0.9)
poisson <- dpois(0:10, 2.5)
barplot(rbind(comp, poisson), beside = TRUE, names= 0:10, legend.text = TRUE)

CompGLM documentation built on May 2, 2019, 3:31 p.m.