PoissonLindley {tolerance} | R 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 |
theta |
The shape parameter, which must be greater than 0. |
log , log.p |
Logical vectors. If |
lower.tail |
Logical vector. If |
Details
The Poisson-Lindley distribution has mass
where and
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)