QLindley: Quasi Lindley 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 quasi Lindley distribution with parameters theta and alpha.

Usage

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

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

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

rqlindley(n, theta, alpha, mixture = TRUE)

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

Arguments

x, q

vector of positive quantiles.

theta

positive parameter.

alpha

greater than -1.

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.

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{θ ≤ft( α +θ x\right) {{e}^{-θ x}}}{1+α }}

Cumulative distribution function

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

Quantile function

Q(p\mid θ ,α )=-\frac{1}{{θ }}-{\frac{α }{θ }}-\frac{1}{{θ }}{W}_{-1}≤ft( ≤ft( p-1\right) ≤ft( 1+α \right) {{e}^{-1-α }}\right)

Hazard rate function

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

where W_{-1} denotes the negative branch of the Lambert W function.

Particular cases: α = θ the one-parameter Lindley distribution and for α=0 the gamma distribution with shape = 2 and scale = θ.

Value

dqlindley gives the density, pqlindley gives the distribution function, qqlindley gives the quantile function, rqlindley generates random deviates and hqlindley 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]qlindley are calculated directly from the definitions. rqlindley uses either a two-component mixture of gamma distributions or the quantile function.

References

Shanker, R. and Mishra, A. (2013). A quasi Lindley distribution. African Journal of Mathematics and Computer Science Research, 6, (4), 64-71.

See Also

lambertWm1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(1)
x <- rqlindley(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, dqlindley(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)
pqlindley(q, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
pqlindley(q, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
qqlindley(p, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
qqlindley(p, theta = 1.5, alpha = 1.5, lower.tail = FALSE)

library(fitdistrplus)
fit <- fitdist(x, 'qlindley', start = list(theta = 1.5, alpha = 1.5))
plot(fit)

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