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

Gompertz

Gompertz distribution


Description

Density, distribution function, quantile function and random generation for the Gompertz distribution.

Usage

dgompertz(x, a = 1, b = 1, log = FALSE)

pgompertz(q, a = 1, b = 1, lower.tail = TRUE, log.p = FALSE)

qgompertz(p, a = 1, b = 1, lower.tail = TRUE, log.p = FALSE)

rgompertz(n, a = 1, b = 1)

Arguments

x, q

vector of quantiles.

a, b

positive valued scale and location parameters.

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

p

vector of probabilities.

n

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

Details

Probability density function

f(x) = a*exp(b*x - a/b * (exp(b*x)-1))

Cumulative distribution function

F(x) = 1-exp(-a/b * (exp(b*x)-1))

Quantile function

F^-1(p) = 1/b * log(1 - b/a * log(1-p))

References

Lenart, A. (2012). The Gompertz distribution and Maximum Likelihood Estimation of its parameters - a revision. MPIDR WORKING PAPER WP 2012-008. http://www.demogr.mpg.de/papers/working/wp-2012-008.pdf

Examples

x <- rgompertz(1e5, 5, 2)
hist(x, 100, freq = FALSE)
curve(dgompertz(x, 5, 2), 0, 1, col = "red", add = TRUE)
hist(pgompertz(x, 5, 2))
plot(ecdf(x))
curve(pgompertz(x, 5, 2), 0, 1, col = "red", lwd = 2, add = TRUE)

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.