Description Usage Arguments Details Value Author(s) Source References See Also Examples
Density function, distribution function, quantile function, random number generation and hazard rate function for the two-parameter Lindley distribution with parameters theta and alpha.
1 2 3 4 5 6 7 8 9 |
x, q |
vector of positive quantiles. |
theta |
positive parameter. |
alpha |
greater than -theta. |
log, log.p |
logical; If TRUE, probabilities p are given as log(p). |
lower.tail |
logical; If TRUE, (default), P(X ≤q x) are returned, otherwise P(X > x). |
p |
vector of probabilities. |
n |
number of observations. If |
mixture |
logical; If TRUE, (default), random deviates are generated from a two-component mixture of gamma distributions, otherwise from the quantile function. |
Probability density function
f(x\mid θ,α )=\frac{{θ }^{2}}{θ +α }≤ft(1+α x\right) e^{-θ x}
Cumulative distribution function
F(x\mid θ,α )=1-\frac{≤ft( θ + α +α θ x\right) }{θ +α }e^{-θ x}
Quantile function
Q(p\mid θ,α )=-\frac{1}{θ }-\frac{1}{α }-\frac{1}{θ }W_{-1}≤ft( \frac{1}{α }(p-1)≤ft( θ +α \right)e^{-{\frac{α +θ }{α }}}\right)
Hazard rate function
h(x\mid θ )=\frac{θ ^{2}}{≤ft( θ + α +αθ x\right) }(1+α x)
where θ > 0, α > -θ and W_{-1} denotes the negative branch of the Lambert W function.
Particular case: α = 1 the one-parameter Lindley distribution.
dslindley
gives the density, pslindley
gives the distribution function, qslindley
gives the quantile function, rslindley
generates random deviates and hslindley
gives the hazard rate function.
Invalid arguments will return an error message.
Josmar Mazucheli jmazucheli@gmail.com
Larissa B. Fernandes lbf.estatistica@gmail.com
[d-h-p-q-r]slindley are calculated directly from the definitions. rslindley
uses either a two-component mixture of the gamma distributions or the quantile function.
Shanker, R., Sharma, S. and Shanker, R. (2013). A two-parameter Lindley distribution for modeling waiting and survival times data. Applied Mathematics, 4, (2), 363-368.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(1)
x <- rslindley(n = 1000, theta = 1.5, alpha = 1.5, mixture = TRUE)
R <- range(x)
S <- seq(from = R[1], to = R[2], by = 0.1)
plot(S, dslindley(S, theta = 1.5, alpha = 1.5), xlab = 'x', ylab = 'pdf')
hist(x, prob = TRUE, main = '', add = TRUE)
p <- seq(from = 0.1, to = 0.9, by = 0.1)
q <- quantile(x, prob = p)
pslindley(q, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
pslindley(q, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
qslindley(p, theta = 1.5, alpha = 1.5, lower.tail = TRUE)
qslindley(p, theta = 1.5, alpha = 1.5, lower.tail = FALSE)
library(fitdistrplus)
fit <- fitdist(x, 'slindley', start = list(theta = 1.5, alpha = 1.5))
plot(fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.