dgenpois {VGAM} | R Documentation |
Density for the Generalized Poisson Distribution.
dgenpois(x, lambda = 0, theta, log = FALSE)
x, |
vector of quantiles. |
lambda, theta |
See |
log |
Logical.
If |
Most of the background to this function is given
in genpoisson
.
Some warnings relevant to this distribution are given there,
especially relating to the complicated range of the
parameter lambda
about or near -1.
Note that numerical round off errors etc. can occur; see below for an example.
dgenpois
gives the density.
The value NaN
is returned for elements not satisfying
the parameter restrictions, e.g., if lambda > 1.
T. W. Yee
sum(dgenpois(0:1000, lambda = -0.5, theta = 2)) # Not perfect... ## Not run: lambda <- -0.2; theta <- 2; y <- 0:10 proby <- dgenpois(y, lambda = lambda, theta = theta, log = FALSE) plot(y, proby, type = "h", col = "blue", lwd = 2, ylab = "P[Y=y]", main = paste("Y ~ Generalized Poisson(lambda=", lambda, ", theta=", theta, ")", sep = ""), las = 1, sub = "Orange is the Poisson probability function") sum(proby) lines(y + 0.1, dpois(y, theta), type = "h", lwd = 2, col = "orange") ## End(Not run)