LindleyE: Lindley Exponential Distribution

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

Description

Density function, distribution function, quantile function, random number generation and hazard rate function for the Lindley exponential distribution with parameters theta and alpha.

Usage

1
2
3
4
5
6
7
8
9
dlindleye(x, theta, alpha, log = FALSE)

plindleye(q, theta, alpha, lower.tail = TRUE, log.p = FALSE)

qlindleye(p, theta, alpha, lower.tail = TRUE, log.p = FALSE)

rlindleye(n, theta, alpha)

hlindleye(x, theta, alpha, log = FALSE)

Arguments

x, q

vector of positive quantiles.

theta, alpha

positive parameters.

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.

Details

Probability density function

f(x\mid θ ,α )={\frac{{θ }^{2}α {{e}^{-α x}}≤ft(1-{{e}^{-α x}}\right) ^{θ -1}≤ft[ 1-\log ≤ft( 1-{{e}^{-α x}}\right) \right] }{1+θ }}

Cumulative distribution function

F(x\mid θ ,α )={\frac{≤ft( 1-{{e}^{-α x}}\right) ^{θ }≤ft[ 1+θ -θ \log ≤ft( 1-{{e}^{-α x}}\right) \right] }{1+θ }}

Quantile function

\code{see Bhati et al., 2015}

Hazard rate function

\code{see Bhati et al., 2015}

Value

dlindleye gives the density, plindleye gives the distribution function, qlindleye gives the quantile function, rlindleye generates random deviates and hlindleye gives the hazard rate function.

Invalid arguments will return an error message.

Author(s)

Josmar Mazucheli jmazucheli@gmail.com

Larissa B. Fernandes lbf.estatistica@gmail.com

Source

[d-h-p-q-r]lindleye are calculated directly from the definitions. rlindleye uses the quantile function.

References

Bhati, D., Malik, M. A., Vaman, H. J., (2015). Lindley-Exponential distribution: properties and applications. METRON, 73, (3), 335–357.

See Also

lambertWm1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
set.seed(1)
x <- rlindleye(n = 1000, theta = 5.0, alpha = 0.2)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.1)
plot(S, dlindleye(S, theta = 5.0, alpha = 0.2), xlab = 'x', ylab = 'pdf')
hist(x, prob = TRUE, main = '', add = TRUE)

p <- seq(from = 0.1, to = 0.9, by = 0.1)
q <- quantile(x, prob = p)
plindleye(q, theta = 5.0, alpha = 0.2, lower.tail = TRUE)
plindleye(q, theta = 5.0, alpha = 0.2, lower.tail = FALSE)
qlindleye(p, theta = 5.0, alpha = 0.2, lower.tail = TRUE)
qlindleye(p, theta = 5.0, alpha = 0.2, lower.tail = FALSE)

## waiting times data (from Ghitany et al., 2008)
data(waitingtimes)
library(fitdistrplus)
fit <- fitdist(waitingtimes, 'lindleye', start = list(theta = 2.6, alpha = 0.15),
 lower = c(0.01, 0.01))
plot(fit)

LindleyR documentation built on May 1, 2019, 8:05 p.m.