sum(dgenpois(0:1000, lambda = -0.5, theta = 2)) # Not perfect...
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