dcomp {CompGLM} | R Documentation |
The PDF of the Conway-Maxwell-Poisson distribution with
parameters lam
and nu
at point y
.
dcomp(y, lam, nu, sumTo = 100L, logP = FALSE)
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
|
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
.
The value of the PDF (or log PDF if logP = TRUE
). Input
vectors are recycled to be same length.
Jeffrey Pollock <jeffpollock9@gmail.com>
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)