Last data update: 2014.03.03
R: Exponentiated Lindley Distribution
EXPLindley R Documentation
Exponentiated Lindley Distribution
Description
Density function, distribution function, quantile function, random number generation and hazard rate function for the exponentiated Lindley distribution with parameters theta and alpha.
Usage
dexplindley(x, theta, alpha, log = FALSE)
pexplindley(q, theta, alpha, lower.tail = TRUE, log.p = FALSE)
qexplindley(p, theta, alpha, lower.tail = TRUE, log.p = FALSE)
rexplindley(n, theta, alpha)
hexplindley(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(xmid θ,α )=frac{α θ ^{2}}{(1+θ )} (1+x)e^{-θ x}≤ft[ 1-≤ft( 1+frac{θ x}{1+θ }
ight) e^{-θ x}
ight] ^{α -1}
Cumulative distribution function
F(xmid θ,α )=≤ft[ 1-≤ft( 1+frac{θ x}{1+θ }
ight) e^{-θ x}
ight] ^{α }
Quantile function
Q(pmid θ ,α )=-1-frac{1}{θ }-{frac{1}{θ }}W_{-1}{≤ft( (p^{frac{1}{α }}-1)≤ft( 1+θ
ight) e{^{-≤ft( 1+θ
ight) }}
ight) }
Hazard rate function
h(xmid θ ,α )={frac{α {θ }^{2}≤ft( 1+x
ight) {{e}^{-θ x}}≤ft[ 1-≤ft( 1+{frac{θ x}{1+θ }}
ight) e{^{-θ x}}
ight] ^{α -1}}{≤ft( 1+θ
ight) ≤ft{ 1-≤ft[ 1-≤ft( 1+frac{θ x}{1+θ }
ight) e^{-θ x}
ight] ^{α}
ight} }}
where W_{-1} denotes the negative branch of the Lambert W function.
Particular case: α = 1 the one-parameter Lindley distribution.
Value
dexplindley
gives the density, pexplindley
gives the distribution function, qexplindley
gives the quantile function, rexplindley
generates random deviates and hexplindley
gives the hazard rate function.
Invalid arguments will return an error message.
Note
Nadarajah et al. (2011) named the exponentiated Lindley distribution as generalized Lindley distribution.
Author(s)
Josmar Mazucheli jmazucheli@gmail.com
Larissa B. Fernandes lbf.estatistica@gmail.com
Source
[d-h-p-q-r]explindley are calculated directly from the definitions. rexplindley
uses the quantile function.
References
Nadarajah, S., Bakouch, H. S., Tahmasbi, R., (2011). A generalized Lindley distribution. Sankhya B , 73 , (2), 331-359.
See Also
lambertWm1
.
Examples
set.seed(1)
x <- rexplindley(n = 1000, theta = 1.5, alpha = 1.5)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.1)
plot(S, dexplindley(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)
pexplindley(q, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
pexplindley(q, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
qexplindley(p, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
qexplindley(p, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
## Relief times data (from Nadarajah et al., 2011)
data(relieftimes)
library(fitdistrplus)
fit <- fitdist(relieftimes, 'explindley', start = list(theta = 1.5, alpha = 1.5))
plot(fit)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(LindleyR)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LindleyR/EXPLindley.Rd_%03d_medium.png", width=480, height=480)
> ### Name: EXPLindley
> ### Title: Exponentiated Lindley Distribution
> ### Aliases: EXPLindley dexplindley hexplindley pexplindley qexplindley
> ### relieftimes rexplindley
>
> ### ** Examples
>
> set.seed(1)
> x <- rexplindley(n = 1000, theta = 1.5, alpha = 1.5)
> R <- range(x)
> S <- seq(from = R[1], to = R[2], by = 0.1)
> plot(S, dexplindley(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)
> pexplindley(q, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
10% 20% 30% 40% 50% 60% 70% 80%
0.1050439 0.2012339 0.3119572 0.3977886 0.4832603 0.5960067 0.7061000 0.7969307
90%
0.9100919
> pexplindley(q, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
10% 20% 30% 40% 50% 60% 70%
0.89495611 0.79876614 0.68804279 0.60221138 0.51673970 0.40399330 0.29390004
80% 90%
0.20306929 0.08990809
> qexplindley(p, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
[1] 0.2575551 0.4329961 0.6018380 0.7769918 0.9680684 1.1869294 1.4532823
[8] 1.8092681 2.3862366
> qexplindley(p, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
[1] 2.3862366 1.8092681 1.4532823 1.1869294 0.9680684 0.7769918 0.6018380
[8] 0.4329961 0.2575551
>
> ## Relief times data (from Nadarajah et al., 2011)
> data(relieftimes)
> library(fitdistrplus)
Loading required package: MASS
> fit <- fitdist(relieftimes, 'explindley', start = list(theta = 1.5, alpha = 1.5))
> plot(fit)
>
>
>
>
>
>
> dev.off()
null device
1
>