| Density Generalized Lindley Distribution | R Documentation |
Gives the density value of a univariate Generalized Lindley Distribution.
dglindley(x, alpha, beta, gamma, log = FALSE)
x |
value or vector of values, to apply in the mixture probability density function. |
alpha |
value of parameter. |
beta |
value of parameter. |
gamma |
value of parameter. |
log |
logical; if TRUE, probabilities p are given as log(p). |
The distribution has density
f(x) = (x^(α - 1) * (α + γ*x) * exp(-x/β))/(β^(α * (β*γ + 1) * Gamma(α + 1))).
CASTRO, M. O.; MONTALVO, G. S. A.
f <- function(x){dglindley(x, alpha = 2, beta = 4, gamma = 3)}
## Plot using graphics package
require(graphics)
curve(f, 0, 30)
require(ggplot2)
## Plot using ggplot2 package
ggplot(data.frame(x=c(0, 30)), aes(x)) +
stat_function(fun=f, size = 1L, colour = "#0c4c8a") +
theme_minimal()
## Integrate
integrate(f, 0, Inf)$value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.