Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

DiscreteGamma

Discrete gamma distribution


Description

Probability mass function, distribution function and random generation for discrete gamma distribution.

Usage

ddgamma(x, shape, rate = 1, scale = 1/rate, log = FALSE)

pdgamma(q, shape, rate = 1, scale = 1/rate, lower.tail = TRUE, log.p = FALSE)

rdgamma(n, shape, rate = 1, scale = 1/rate)

Arguments

x, q

vector of quantiles.

shape, scale

shape and scale parameters. Must be positive, scale strictly.

rate

an alternative way to specify the scale.

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].

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Probability mass function of discrete gamma distribution f is defined by discretization of continuous gamma distribution f(y) = S(x) - S(x+1) where S is a survival function of continuous gamma distribution.

References

Chakraborty, S. and Chakravarty, D. (2012). Discrete Gamma distributions: Properties and parameter estimations. Communications in Statistics-Theory and Methods, 41(18), 3301-3324.

See Also

Examples

x <- rdgamma(1e5, 9, 1)
xx <- 0:50
plot(prop.table(table(x)))
lines(xx, ddgamma(xx, 9, 1), col = "red")
hist(pdgamma(x, 9, 1))
plot(ecdf(x))
xx <- seq(0, 50, 0.1)
lines(xx, pdgamma(xx, 9, 1), col = "red", lwd = 2, type = "s")

extraDistr

Additional Univariate and Multivariate Distributions

v1.9.1
GPL-2
Authors
Tymoteusz Wolodzko
Initial release
2020-08-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.