Learn R Programming

reliaR (version 0.01)

Gompertz: The Gompertz distribution

Description

Density, distribution function, quantile function and random generation for the Gompertz distribution with shape parameter alpha and scale parameter theta.

Usage

dgompertz(x, alpha, theta, log = FALSE) pgompertz(q, alpha, theta, lower.tail = TRUE, log.p = FALSE) qgompertz(p, alpha, theta, lower.tail = TRUE, log.p = FALSE) rgompertz(n, alpha, theta)

Arguments

x,q
vector of quantiles.
p
vector of probabilities.
n
number of observations. If length(n) > 1, the length is taken to be the number required.
alpha
shape parameter.
theta
scale parameter.
log, log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are $P[X \le x]$ otherwise, $P[X > x]$.

Value

dgompertz gives the density, pgompertz gives the distribution function, qgompertz gives the quantile function, and rgompertz generates random deviates.

Details

The Gompertz distribution has density $$f(x) = \theta e^{\alpha x} \exp\left\{\frac{\theta}{\alpha}\left(1 - e^{\alpha x}\right)\right\};\, x \ge 0, \theta > 0, -\infty < \alpha < \infty.$$ where $\alpha$ and $\theta$ are the shape and scale parameters, respectively.

References

Marshall, A. W., Olkin, I. (2007). Life Distributions: Structure of Nonparametric, Semiparametric, and Parametric Families, Springer, New York.

See Also

.Random.seed about random number; sgompertz for Gompertz survival / hazard etc. functions

Examples

Run this code
## Load data sets
data(sys2)
## Maximum Likelihood(ML) Estimates of alpha & theta for the data(sys2)
## Estimates of alpha & theta using 'maxLik' package
## alpha.est = 0.00121307, theta.est = 0.00173329

dgompertz(sys2, 0.00121307, 0.00173329, log = FALSE)
pgompertz(sys2, 0.00121307, 0.00173329, lower.tail = TRUE, log.p = FALSE)
qgompertz(0.25, 0.00121307, 0.00173329, lower.tail=TRUE, log.p = FALSE)
rgompertz(30, 0.00121307, 0.00173329)

Run the code above in your browser using DataLab