GExp: Generalized Exponential Distribution

Description Usage Arguments Details Value Author(s) Source References See Also Examples

Description

Density, distribution function, quantile function and random generation for the GExp distribution with parameters alpha, lambda and mu.

Usage

1
2
3
4
5
6
7
dgexp(x, alpha, lambda, mu, log = FALSE)

pgexp(q, alpha, lambda, mu, lower.tail = TRUE, log.p = FALSE)

qgexp(p, alpha, lambda, mu, lower.tail = TRUE, log.p = FALSE)

rgexp(n, alpha, lambda, mu, cens.prop = 0)

Arguments

x, q

numeric vector of quantiles. x > μ.

alpha

shape parameter α > 0.

lambda

shape parameter λ > 0.

mu

location parameter μ < x.

log, log.p

logical; if TRUE, probabilities/densities p are given as log(p).

lower.tail

logical; if TRUE, probabilities are P[X ≤ x], otherwise, P[X ≥ x]

n

desired size of the random number sample.

cens.prop

proportion of censored data to be simulated. If greater than 0, a matrix will be returned instead of a vector. The matrix will contain the random values and a censorship indicator variable.

Details

The GExp distribution has density

f(x) = (α/λ)(1-e^(-(x-μ)/λ))^(α-1)e^(-(x-μ)/λ)

with shape parameter α, scale parameter λ and location parameter μ and x > μ as described by Gupta and Kundu (1999).

With alpha = 1 GExp equals the Two-parameter Exponential distribution with rate = 1/lambda. Such dsitribution can be computed by a Exponential transforming the variable g(x) = x - mu.

With alpha = 1 and mu = 0 GExp equals the usual Exponential distribution.

Value

dgexp gives the density, pgexp gives the distribution function, qgexp gives the quantile function, and rgexp generates random values.

The length of the result is determined by n for rgexp, for the other fucntions the length is the same as the vector passed to the first argument.

Only the first element of the logical arguments are used.

Author(s)

Anderson Neisse <a.neisse@gmail.com>

Source

The source code of all distributions in this package can also be found on the survdistr Github repository.

References

GUPTA, R. D.; KUNDU, D. Theory & methods: Generalized exponential distributions. Australian & New Zealand Journal of Statistics, 1999, 41.2: 173-188.

LAWLESS, J. F. Prediction intervals for the two parameter exponential distribution. Technometrics, 1977, 19.4: 469-472.

See Also

LINK TO OTHER PACKAGE DISTRIBUTIONS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Equivalency with the Two-parameter Exponential distribution
all.equal(dgexp(5, alpha = 1, lambda = 2, mu = 3),
          dexp(5 - 3, rate = 1/2))

# Equivalency with the exponential distribution
all.equal(dgexp(5, alpha = 1, lambda = 2, mu = 0),
          dexp(5, rate = 1/2))

# Generating values and comparing with the function
x <- rgexp(10000, alpha = 1.5, lambda = 2, mu = 3)
hist(x, probability = T, ylim = c(0, 0.5), breaks = 100)
curve(dgexp(x, alpha = 1.5, lambda = 2, mu = 3),
      from = 0, to = 25, add = T)

aneisse/survdistr documentation built on May 22, 2019, 2:16 p.m.