Skip to contents

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

Usage

ddLd1(x, theta, log = FALSE)

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

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

rdLd1(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

ddLd1 gives the density, pdLd1 gives the distribution function, qdLd1 gives the quantile function and rdLd1 generates random deviates.

Details

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

References

Gómez-Déniz, E. ve Calderín-Ojeda, E., 2011, The discrete Lindley distribution: properties and applications.Journal of statistical computation and simulation, 81 (11), 1405-1416.

Examples

library(new.dist)
ddLd1(1,theta=2)
#> [1] 0.1828223
pdLd1(2,theta=1)
#> [1] 0.8755323
qdLd1(.993,theta=2)
#> [1] 3
rdLd1(10,theta=1)
#>  [1] 0 0 0 0 0 1 0 2 1 2