R: The Generalized Poisson Distribution

dgenpois {VGAM} | R Documentation

## The Generalized Poisson Distribution

### Description

Density for the Generalized Poisson Distribution.

### Usage

    dgenpois(x, lambda = 0, theta, log = FALSE)

### Arguments

`x,` | vector of quantiles.
`lambda, theta` | See `genpoisson`. The default value of `lambda` corresponds to an ordinary Poisson distribution.
`log` | Logical. If `TRUE` then the logarithm of the density is returned.

### Details

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.

### Value

`dgenpois` gives the density. The value `NaN` is returned for elements not satisfying the parameter restrictions, e.g., if lambda > 1.

### Author(s)

T. W. Yee

### See Also

`genpoisson`, `dpois`.

### Examples

    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)

[Package VGAM version 1.0-3 Index]