poislind: Discrete Poisson-Lindley Distribution

PoissonLindleyR Documentation

Discrete Poisson-Lindley Distribution

Description

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

Usage

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\le x], else P[X>x].

Details

The Poisson-Lindley distribution has mass

p(x) = \frac{\theta^{2}(x + \theta + 2)}{(\theta + 1)^{x+3}},

where x=0,1,\ldots and \theta>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.

See Also

runif and .Random.seed about random number generation.

Examples

## 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)

tolerance documentation built on May 29, 2024, 7:38 a.m.