ugompertz: unit-Gompertz distribution

Description Usage Arguments Value Author(s) Examples

Description

Density function, distribution function, quantile function, random number generation function for the unit-Gompertz distribution re-parametrized in terms of the mode.

Usage

1
2
3
4
5
6
7
dugompertz(x, mu, phi, log = FALSE)

pugompertz(q, mu, phi, lower.tail = TRUE, log.p = FALSE)

qugompertz(p, mu, phi, lower.tail = TRUE, log.p = FALSE)

rugompertz(n, mu, phi)

Arguments

x, q

vector of positive quantiles.

mu

location parameter indicating the mode.

phi

shape parameter.

log, log.p

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

lower.tail

logical; If TRUE, (default), P(X ≤q 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.

Author(s)

André Felipe B. Menezes andrefelipemaringa@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(6969)
x <- rugompertz(n = 1e4, mu = 0.5, phi = 1.0)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.01)
hist(x, prob = TRUE, main = 'unit-gompertz distribution')
lines(S, dugompertz(x = S, mu = 0.5, phi = 1.0), col = 2)
plot(ecdf(x))
lines(S, pugompertz(q = S, mu = 0.5, phi = 1.0), col = 2)
plot(quantile(x, probs = S), type = "l")
lines(qugompertz(p = S, mu = 0.5, phi = 1.0), col = 2)

AndrMenezes/unitModalReg documentation built on March 12, 2021, 5:24 a.m.