Skip to contents

Density, distribution function, quantile function and random generation for the Lindley distribution.

Usage

dLd(x, theta, log = FALSE)

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

qLd(p, theta, lower.tail = TRUE)

rLd(n, theta)

Arguments

x, q

vector of quantiles.

theta

a parameter.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are \(P\left[ X\leq x\right]\), otherwise, \(P\left[ X>x\right] \).

p

vector of probabilities.

n

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

Value

dLd gives the density, pLd gives the distribution function, qLd gives the quantile function and rLd generates random deviates.

Details

The Lindley distribution with a parameter \(\theta\), has density $$f\left( x\right) =\frac{\theta ^{2}}{1+\theta }\left( 1+x\right) e^{-\theta~x},$$ where $$x>0,~\theta >0.$$

References

Akgül, F. G., Acıtaş, Ş. ve Şenoğlu, B., 2018, Inferences on stress–strength reliability based on ranked set sampling data in case of Lindley distribution, Journal of statistical computation and simulation, 88 (15), 3018-3032.

Examples

library(new.dist)
dLd(1,theta=2)
#> [1] 0.3608941
pLd(1,theta=2)
#> [1] 0.7744412
qLd(.8,theta=1)
#> [1] 2.397276
rLd(10,theta=1)
#>  [1] 1.4649952 0.9529215 0.5242191 0.9644740 0.8558721 0.1840038 0.4526511
#>  [8] 1.3461015 1.0110481 0.1589970