# poislind: Discrete Poisson-Lindley Distribution In tolerance: Statistical Tolerance Intervals and Regions

## Description

Density (mass), distribution function, quantile function, and random generation for the Poisson-Lindley distribution.

## Usage

 1 2 3 4 dpoislind(x, theta, log = FALSE) ppoislind(q, theta, lower.tail = TRUE, log.p = FALSE) qpoislind(p, theta, lower.tail = TRUE, log.p = FALSE) rpoislind(n, theta)

## Arguments

 x, q Vector of quantiles. p Vector of probabilities. n The number of observations. If length>1, then the length is taken to be the number required. theta The shape parameter, which must be greater than 0. log, log.p Logical vectors. If TRUE, then the probabilities are given as log(p). lower.tail Logical vector. If TRUE, then probabilities are P[X≤ x], else P[X>x].

## Details

The Poisson-Lindley distribution has mass

p(x) = (θ^2(x + θ + 2))/(θ + 1)^(x+3),

where x=0,1,… and θ>0 is the shape parameter.

## Value

dpoislind gives the density (mass), ppoislind gives the distribution function, qpoislind gives the quantile function, and rpoislind generates random deviates for the specified distribution.

## References

Ghitany, M. E. and Al-Mutairi, D. K. (2009), Estimation Methods for the Discrete Poisson-Lindley Distribution, Journal of Statistical Computation and Simulation, 79, 1–9.

Sankaran, M. (1970), The Discrete Poisson-Lindley Distribution, Biometrics, 26, 145–149.

runif and .Random.seed about random number generation.

## Examples

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ## Randomly generated data from the Poisson-Lindley ## distribution. set.seed(100) x <- rpoislind(n = 150, theta = 0.5) hist(x, main = "Randomly Generated Data", prob = TRUE) x.1 <- sort(x) y <- dpoislind(x = x.1, theta = 0.5) lines(x.1, y, col = 2, lwd = 2) plot(x.1, ppoislind(q = x.1, theta = 0.5), type = "l", xlab = "x", ylab = "Cumulative Probabilities") qpoislind(p = 0.20, theta = 0.5, lower.tail = FALSE) qpoislind(p = 0.80, theta = 0.5)

### Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE