| genpois | R Documentation |
Probability mass function, distribution function, and random generation for the generalised Poisson distribution.
dgenpois(x, lambda = 1, phi = 1, log = FALSE)
pgenpois(q, lambda = 1, phi = 1, lower.tail = TRUE, log.p = FALSE)
qgenpois(p, lambda = 1, phi = 1,
lower.tail = TRUE, log.p = FALSE, max.value = 10000)
rgenpois(n, lambda = 1, phi = 1, max.value = 10000)
x, q |
integer vector of counts |
lambda |
vector of positive means |
phi |
vector of non-negative dispersion parameters |
log, log.p |
logical; return log-density if TRUE |
lower.tail |
logical; if |
p |
vector of probabilities |
max.value |
a constant, set to the default value of 10000 for how far the algorithm should look for |
n |
number of random values to return. |
This implementation of dgenpois allows for automatic differentiation with RTMB.
The other functions are imported from gamlss.dist::GPO.
The distribution has mean \lambda and variance \lambda(1 + \phi \lambda)^2.
For \phi = 0 it reduces to the Poisson distribution, however \phi must be strictly positive here.
dgenpois gives the probability mass function, pgenpois gives the distribution function, qgenpois gives the quantile function, and rgenpois generates random deviates.
set.seed(123)
x <- rgenpois(1, 2, 3)
d <- dgenpois(x, 2, 3)
p <- pgenpois(x, 2, 3)
q <- qgenpois(p, 2, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.