Skip to contents

Density function, distribution function, quantile function and random number deviates for the unit-Gompertz distribution reparametrized in terms of the \(\tau\)-th quantile, \(\tau \in (0, 1)\).

Usage

dugompertz(x, mu, theta, tau = 0.5, log = FALSE)

pugompertz(q, mu, theta, tau = 0.5, lower.tail = TRUE, log.p = FALSE)

qugompertz(p, mu, theta, tau = 0.5, lower.tail = TRUE, log.p = FALSE)

rugompertz(n, mu, theta, tau = 0.5)

Arguments

x, q

vector of positive quantiles.

mu

location parameter indicating the \(\tau\)-th quantile, \(\tau \in (0, 1)\).

theta

nonnegative shape parameter.

tau

the parameter to specify which quantile is to be used.

log, log.p

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

lower.tail

logical; If TRUE, (default), \(P(X \leq{x})\) are returned, 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.

Value

dugompertz gives the density, pugompertz gives the distribution function, qugompertz gives the quantile function and rugompertz generates random deviates.

Invalid arguments will return an error message.

Details

Probability density function $$f(y\mid \alpha ,\theta )=\frac{\alpha \theta }{x}\exp \left\{ \alpha -\theta \log \left( y\right) -\alpha \exp \left[ -\theta \log \left( y\right) \right] \right\} $$

Cumulative density function $$F(y\mid \alpha ,\theta )=\exp \left[ \alpha \left( 1-y^{\theta }\right) \right] $$

Quantile Function $$Q(\tau \mid \alpha ,\theta )=\left[ \frac{\alpha -\log \left( \tau \right) }{\alpha }\right] ^{-\frac{1}{\theta }} $$

Reparameterization $$\alpha =g^{-1}(\mu )=\frac{\log \left( \tau \right) }{1-\mu ^{\theta }}$$

References

Mazucheli, J., Menezes, A. F. and Dey, S., (2019). Unit-Gompertz Distribution with Applications. Statistica, 79(1), 25-43.

Author

Josmar Mazucheli jmazucheli@gmail.com

André F. B. Menezes andrefelipemaringa@gmail.com

Examples

set.seed(123)
x <- rugompertz(n = 1000, mu = 0.5, theta = 2, tau = 0.5)
R <- range(x)
S <- seq(from = R[1], to = R[2], by =  0.01)
hist(x, prob = TRUE, main = 'unit-Gompertz')
lines(S, dugompertz(x = S, mu = 0.5, theta = 2, tau = 0.5), col = 2)

plot(ecdf(x))
lines(S, pugompertz(q = S, mu = 0.5, theta = 2, tau = 0.5), col = 2)

plot(quantile(x, probs = S), type = "l")
lines(qugompertz(p = S, mu = 0.5, theta = 2, tau = 0.5), col = 2)