| GLL | R Documentation |
Density, distribution function, quantile function, hazard, cumulative hazard, and random generation for the generalized log-logistic distribution.
dGLL(x, rate, shape = 1, theta = 0, log = FALSE)
pGLL(q, rate, shape = 1, theta = 0)
qGLL(p, rate, shape = 1, theta = 0)
rGLL(n, rate, shape = 1, theta = 0)
hGLL(x, rate, shape = 1, theta = 0)
HGLL(x, rate, shape = 1, theta = 0)
x, q |
vector of quantiles. |
rate |
positive rate parameter of the distribution. |
shape |
positive shape parameter of the distribution. |
theta |
non-negative additional parameter of the distribution, with default
value |
log |
logical; if |
p |
vector of probabilities. |
n |
number of observations. Must be a single non-negative integer. |
The generalized log-logistic distribution with rate parameter \lambda > 0,
shape parameter \alpha > 0, and parameter \theta \ge 0 has survival
function
S(t \mid \lambda, \alpha, \theta) =
\left(1 + \theta \lambda t^\alpha\right)^{-1 / \theta},
\qquad \theta > 0.
The corresponding cumulative distribution function is
F(t \mid \lambda, \alpha, \theta) =
1 - \left(1 + \theta \lambda t^\alpha\right)^{-1 / \theta}.
The quantile function is
Q(p \mid \lambda, \alpha, \theta) =
\left(
\frac{(1 - p)^{-\theta} - 1}{\theta \lambda}
\right)^{1 / \alpha},
\qquad 0 \le p \le 1,\ \theta > 0.
The cumulative hazard function is
H(t \mid \lambda, \alpha, \theta) =
\frac{\log\left(1 + \theta \lambda t^\alpha\right)}{\theta}.
The density function is
f(t \mid \lambda, \alpha, \theta) =
\lambda \alpha t^{\alpha - 1}
\left(1 + \theta \lambda t^\alpha\right)^{-1 / \theta - 1}.
For dGLL(..., log = TRUE), the logarithm of the density is returned. For
\theta > 0,
\log f(t \mid \lambda, \alpha, \theta) =
\log(\lambda) + \log(\alpha) + (\alpha - 1)\log(t)
- \left(\frac{1}{\theta} + 1\right)\log\left(1 + \theta \lambda t^\alpha\right).
The hazard function is
h(t \mid \lambda, \alpha, \theta) =
\frac{\lambda \alpha t^{\alpha - 1}}
{1 + \theta \lambda t^\alpha}.
Random generation is performed by inverse transform sampling. If
U \sim \mathrm{Uniform}(0,1), then
T = Q(U \mid \lambda, \alpha, \theta)
has the generalized log-logistic distribution.
As \theta \to 0, this reduces to the Weibull distribution with survival
function
S(t \mid \lambda, \alpha) = \exp\left(-\lambda t^\alpha\right).
The corresponding quantile function is
Q(p \mid \lambda, \alpha) =
\left(
\frac{-\log(1 - p)}{\lambda}
\right)^{1 / \alpha}.
In this case, dGLL(..., log = TRUE) returns the corresponding Weibull
log-density.
This corresponds to the Weibull distribution in stats::dweibull(),
stats::pweibull(), stats::qweibull(), and stats::rweibull() with
shape = shape and scale = rate^(-1 / shape).
When \theta = 1, the survival function becomes
S(t \mid \lambda, \alpha, 1) = \left(1 + \lambda t^\alpha\right)^{-1},
corresponding to the log-logistic distribution.
For dGLL(), pGLL(), qGLL(), hGLL(), and HGLL(), a numeric vector of
the same length as the main input (x, q, or p). For rGLL(), a numeric
vector of length n.
Wienke A. Frailty Models in Survival Analysis. Chapman and Hall/CRC (2010).
rweibullGF() for simulation of a Weibull distribution with gamma frailty.
## Example 1: Compare the density of GLL with different values of `theta`
x <- seq(0, 10, length.out = 100)
y1 <- pGLL(x, rate = 0.5, shape = 2, theta = 1)
y0 <- pGLL(x, rate = 0.5, shape = 2, theta = 0)
plot(x, y1, type = "l", ylab = "Cumulative distribution function")
lines(x, y0, col = "red", lty = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.