genpois1UC.RdDensity, distribution function, quantile function and random generation for two parameterizations (GP-1 and GP-2) of the generalized Poisson distribution of the mean.
dgenpois1(x, meanpar, dispind = 1, log = FALSE)
pgenpois1(q, meanpar, dispind = 1, lower.tail = TRUE)
qgenpois1(p, meanpar, dispind = 1)
rgenpois1(n, meanpar, dispind = 1)
dgenpois2(x, meanpar, disppar = 0, log = FALSE)
pgenpois2(q, meanpar, disppar = 0, lower.tail = TRUE)
qgenpois2(p, meanpar, disppar = 0)
rgenpois2(n, meanpar, disppar = 0)Vector of quantiles.
Vector of probabilities.
Similar to runif.
The mean and dispersion index (index of dispersion), which
are the two parameters for the GP-1.
The mean is positive while the dispind
is \(\geq 1\).
The default value of dispind corresponds to an
ordinary Poisson distribution.
The dispersion parameter for the GP-2:
disppar \(\geq 0\).
The default value of disppar corresponds to an
ordinary Poisson distribution.
See Genpois0.
dgenpois1 and dgenpois2 give the density,
pgenpois1 and dgenpois2 give the distribution function,
qgenpois1 and dgenpois2 give the quantile function, and
rgenpois1 and dgenpois2 generate random deviates.
See Genpois0 for more information.
These are wrapper functions for those in Genpois0.
The first parameter is the mean,
therefore both the GP-1 and GP-2 are recommended for regression
and can be compared somewhat
to poissonff and negbinomial.
The variance of a GP-1 is \(\mu \varphi\)
where \(\varphi = 1 / (1 - \lambda)^2\) is dispind.
The variance of a GP-2 is \(\mu (1 + \alpha \mu)^2\)
where \(\theta = \mu / (1 + \alpha \mu)\),
\(\lambda = \alpha \mu / (1 + \alpha \mu)\),
and is \(\alpha\) is the dispersion parameter disppar.
Thus the variance is linear with respect to the mean for GP-1
while
the variance is cubic with respect to the mean for GP-2.
Recall that the index of dispersion (also known as the dispersion index) is the ratio of the variance and the mean. Also, \(\mu = \theta /(1 - \lambda)\) in the original formulation with variance \(\theta /(1 - \lambda)^3\). The GP-1 is due to Consul and Famoye (1992). The GP-2 is due to Wang and Famoye (1997).
Consul, P. C. and Famoye, F. (1992). Generalized Poisson regression model. Comm. Statist.—Theory and Meth., 2, 89–109.
Wang, W. and Famoye, F. (1997). Modeling household fertility decisions with generalized Poisson regression. J. Population Econom., 10, 273–283.
Genpois0 has warnings that should be heeded.
sum(dgenpois1(0:1000, meanpar = 5, dispind = 2))
#> [1] 1
if (FALSE) dispind <- 5; meanpar <- 5; y <- 0:15
proby <- dgenpois1(y, meanpar = meanpar, dispind)
#> Error: object 'dispind' not found
plot(y, proby, type = "h", col = "blue", lwd = 2, ylab = "P[Y=y]",
main = paste0("Y ~ GP-1(meanpar=", meanpar, ", dispind=",
dispind, ")"), las = 1, ylim = c(0, 0.3),
sub = "Orange is the Poisson probability function")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'y' in selecting a method for function 'plot': object 'proby' not found
lines(y + 0.1, dpois(y, meanpar), type = "h", lwd = 2, col = "orange") # \dontrun{}
#> Error in plot.xy(xy.coords(x, y), type = type, ...): plot.new has not been called yet