Learn R Programming

gamlss.dist (version 6.1-1)

GPO: The generalised Poisson distribution

Description

The GPO() function defines the generalised Poisson distribution, a two parameter discrete distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss(). The functions dGPO, pGPO, qGPO and rGPO define the density, distribution function, quantile function and random generation for the Delaporte GPO(), distribution.

Usage

GPO(mu.link = "log", sigma.link = "log")

dGPO(x, mu = 1, sigma = 1, log = FALSE)

pGPO(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE)

qGPO(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE, max.value = 10000)

rGPO(n, mu = 1, sigma = 1, max.value = 10000)

Value

Returns a gamlss.family object which can be used to fit a Generalised Poisson distribution in the gamlss() function.

Arguments

mu.link

Defines the mu.link, with "log" link as the default for the mu parameter

sigma.link

Defines the sigma.link, with "log" link as the default for the sigma parameter

x

vector of (non-negative integer) quantiles

mu

vector of positive mu

sigma

vector of positive dispersion parameter sigma

p

vector of probabilities

q

vector of quantiles

n

number of random values to return

log, log.p

logical; if TRUE, probabilities p are given as log(p)

lower.tail

logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]

max.value

a constant, set to the default value of 10000 for how far the algorithm should look for q

Author

Rigby, R. A., Stasinopoulos D. M.

Details

The probability function of the Generalised Poisson distribution is given by $$P(Y=y|\mu,\sigma)= \left(\frac{\mu}{1+\sigma \mu}\right)^y \frac{\left(1+\sigma y \right)^{y-1}}{y!} \exp \left[\frac{- \mu \left( 1+\sigma y\right)}{1+\sigma \mu} \right] $$ for \(y=0,1,2,...,\infty\) where \(\mu>0\) and \(\sigma>0\) see pp. 481-483 of Rigby et al. (2019).

References

Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC, tools:::Rd_expr_doi("10.1201/9780429298547"). An older version can be found in https://www.gamlss.com/.

Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, tools:::Rd_expr_doi("10.18637/jss.v023.i07").

Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. tools:::Rd_expr_doi("10.1201/b21973")

(see also https://www.gamlss.com/).

See Also

gamlss.family, PO , DPO

Examples

Run this code
GPO()# gives information about the default links for the
#plot the pdf using plot 
plot(function(y) dGPO(y, mu=10, sigma=1 ), from=0, to=100, n=100+1, type="h") # pdf
# plot the cdf
plot(seq(from=0,to=100),pGPO(seq(from=0,to=100), mu=10, sigma=1), type="h")   # cdf
# generate random sample
tN <- table(Ni <- rGPO(100, mu=5, sigma=1))
r <- barplot(tN, col='lightblue')

Run the code above in your browser using DataLab