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.$$