Gompertz | R Documentation |
Density, distribution function, quantile function and random generation for the Gompertz distribution.
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)
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 |
vector of probabilities. |
n |
number of observations. If |
Probability density function
f(x) = a \exp\left(bx - \frac{a}{b} (\exp(bx)-1)\right)
Cumulative distribution function
F(x) = 1-\exp\left(-\frac{a}{b} (\exp(bx)-1)\right)
Quantile function
F^{-1}(p) = \frac{1}{b} \log\left(1-\frac{b}{a}\log(1-p)\right)
Lenart, A. (2012). The Gompertz distribution and Maximum Likelihood Estimation of its parameters - a revision. MPIDR WORKING PAPER WP 2012-008. https://www.demogr.mpg.de/papers/working/wp-2012-008.pdf
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.