loglogistic {icensBKL}R Documentation

Log-logistic distribution

Description

Density, distribution function, quantile function and random generation for the log-logistic distribution.

Usage

dllogis(x, shape, scale=1, log=FALSE)

pllogis(q, shape, scale=1, lower.tail=TRUE, log.p=FALSE)

qllogis(p, shape, scale=1, lower.tail=TRUE, log.p=FALSE)

rllogis(n, shape, scale=1)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

shape

the shape parameter \gamma.

scale

the scale parameter \alpha^{-1}.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are \mbox{P}(X\leq x), otherwise, \mbox{P}(X > x).

Details

Log-logistic distribution \mbox{LL}(\alpha,\,\gamma) has a density

f(x) = \displaystyle\frac{\alpha\gamma(\alpha\,x)^{\gamma-1}}{\bigl\{1 + (\alpha\,x)^{\gamma}\bigr\}^{2}},\quad x>0,

and a distribution function

F(x) = \displaystyle 1 - \frac{1}{(1 + (\alpha\,x)^\gamma)}, x>0,

where \alpha and \gamma are positive parameters (\alpha is the inverse of the scale parameter and \gamma is the shape parameter). The mean and the variance are given by

\begin{array}{rcll} \mbox{E}X & \;=\; & \displaystyle \frac{1}{\alpha}\,\frac{\pi}{\gamma\sin\bigl(\frac{\pi}{\gamma}\bigr)}, &\quad \gamma > 1, \\[4ex] \mbox{var}X & \;=\; & \displaystyle \frac{1}{\alpha^2}\, \biggl\{\frac{2\pi}{\gamma\sin\bigl(\frac{2\pi}{\gamma}\bigr)}\,-\, \frac{\pi^2}{\gamma^2\sin^2\bigl(\frac{\pi}{\gamma}\bigr)}\biggr\}, &\quad \gamma > 2, \\[4ex] \end{array}

Value

dllogis gives the density, pllogis gives the distribution function, qllogis gives the quantile function, and rllogis generates random deviates.

Author(s)

Arnošt Komárek arnost.komarek@mff.cuni.cz

See Also

Logistic.

Examples

set.seed(1977)
print(x <- rllogis(10, shape=3, scale=5))
print(d <- dllogis(x, shape=3, scale=5))
print(p <- pllogis(x, shape=3, scale=5))
qllogis(p, shape=3, scale=5)

[Package icensBKL version 1.5 Index]