
Density for the Generalized Poisson Distribution.
dgenpois(x, lambda = 0, theta, log = FALSE)
vector of quantiles.
See genpoisson
.
The default value of lambda
corresponds to an
ordinary Poisson distribution.
Logical.
If TRUE
then the logarithm of the density is returned.
dgenpois
gives the density.
The value NaN
is returned for elements not satisfying
the parameter restrictions, e.g., 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
Note that numerical round off errors etc. can occur; see below for an example.
# NOT RUN {
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")
# }
Run the code above in your browser using DataLab