WLindley: Weighted Lindley Distribution

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

Description

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

Usage

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

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

qwlindley(p, theta, alpha, lower.tail = TRUE, log.p = FALSE, L = 1e-04,
  U = 50)

rwlindley(n, theta, alpha, mixture = TRUE, L = 1e-04, U = 50)

hwlindley(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.

L, U

interval which uniroot searches for a root (quantile), L = 1e-4 and U = 50 are the default values.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mixture

logical; If TRUE, (default), random deviates are generated from a two-component mixture of gamma distributions, otherwise from the quantile function.

Details

Probability density function

f( x\mid θ,α) =\frac{θ ^{α +1}}{≤ft( θ+α \right) Γ ≤ft( α \right) }x^{α -1}≤ft( 1+x\right)e^{-θ x} \label{density-weighted-lindley}

Cumulative distribution function

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

Quantile function

\code{does not have a closed mathematical expression}

Hazard rate function

h(x\mid θ,α) =\frac{θ ^{α +1}x^{α-1}≤ft( 1+x\right) e^{-θ x}}{≤ft( θ +α \right) Γ≤ft( α,θ x\right) +≤ft( θ x\right) ^{α }e^{-θ x}}

where Γ ≤ft(α,θ x\right) = \int_{θ x}^{∞}x^{α -1}e^{-x}dx is the upper incomplete gamma function.

Particular case: α=1 the one-parameter Lindley distribution.

Value

dwlindley gives the density, pwlindley gives the distribution function, qwlindley gives the quantile function, rwlindley generates random deviates and hwlindley gives the hazard rate function.

Invalid arguments will return an error message.

Note

The uniroot function with default arguments is used to find out the quantiles.

Author(s)

Josmar Mazucheli jmazucheli@gmail.com

Larissa B. Fernandes lbf.estatistica@gmail.com

Source

[d-h-p-q-r]wlindley are calculated directly from the definitions. rwlindley uses either a two-component mixture of the gamma distributions or the quantile function.

References

Al-Mutairi, D. K., Ghitany, M. E., Kundu, D., (2015). Inferences on stress-strength reliability from weighted Lindley distributions. Communications in Statistics - Theory and Methods, 44, (19), 4096-4113.

Bashir, S., Rasul, M., (2015). Some properties of the weighted Lindley distribution. EPRA Internation Journal of Economic and Business Review, 3, (8), 11-17.

Ghitany, M. E., Alqallaf, F., Al-Mutairi, D. K. and Husain, H. A., (2011). A two-parameter weighted Lindley distribution and its applications to survival data. Mathematics and Computers in Simulation, 81, (6), 1190-1201.

Mazucheli, J., Louzada, F., Ghitany, M. E., (2013). Comparison of estimation methods for the parameters of the weighted Lindley distribution. Applied Mathematics and Computation, 220, 463-471.

Mazucheli, J., Coelho-Barros, E. A. and Achcar, J. (2016). An alternative reparametrization on the weighted Lindley distribution. Pesquisa Operacional, (to appear).

See Also

lambertWm1, uniroot, DWLindley.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(1)
x <- rwlindley(n = 1000, theta = 1.5, alpha = 1.5, mixture = TRUE)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.1)
plot(S, dwlindley(S, theta = 1.5, alpha = 1.5), 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)
pwlindley(q, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
pwlindley(q, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
qwlindley(p, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
qwlindley(p, theta = 1.5, alpha = 1.5, lower.tail = FALSE)

## carbon fibers data (from Ghitany et al., 2013)
data(carbonfibers)
library(fitdistrplus)
fit <- fitdist(carbonfibers, 'wlindley', start = list(theta = 0.1, alpha = 0.1))
plot(fit)

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