Learn R Programming

windAC (version 1.2.2)

LogLogistic: Log-Logistic Distribution

Description

The probability density function, cumulative density function, inverse cumulative density function, random generation for the log logistic distribution.

Usage

dllog(x, shape = 1, scale = 1, log = FALSE, ...)

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

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

rllog(n, shape = 1, scale = 1, ...)

Arguments

x

Vector of quantiles.

shape

Shape parameter.

scale

Scale parameter.

log

Logical; if TRUE, log densities are returned.

...

Currently ignored.

q

Vector of quantiles.

lower.tail

Logical; if TRUE (default), probabilities are P(X <= x) otherwise, P(X > x).

log.p

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

p

Vector of probabilities.

n

Number of observations. If length(n) > 1, the length is taken to be the number required.

Value

dllog returns vector of the densities.

pllog returns a vector of probabilities.

qllog returns a vector of quantiles.

rllog returns a vector of random log-logistic variates.

Details

If X is a random variable distributed according to a logistic distribution, then Y = exp(X) has a log-logistic distribution.

The log-logistic distribution with parameters shape = a and scale = s has density $$f(x) = \frac{(\frac{x}{\exp{s}})^{\frac{1}{a} - 1}}{a\exp{s}(1+(\frac{x}{\exp{s}})^{1/a})^2}$$ for x >= 0, a > 1, and s > 0. The median is log(s), mean is $$\frac{a\pi\exp{s}}{sin(a*\pi)}$$ for 1/s > 1. The variance is $$(log(s))^2(\frac{2}{a(sin(2/a))}- \frac{1}{a^2(sin^2(1/a))})$$ for 1/s > 2. The mode is $$exp(s)(\frac{(1/a) - 1}{(1/a) + 1})^{a}$$ for 1/s > 1 otherwise it is zero.

See Also

dlogis plogis qlogis rlogis

Examples

Run this code
# NOT RUN {
y <- rllog(5,shape=1,scale=1/3)
dllog(x=y,shape=1,scale=1/3)
dlogis(x=log(y),location=1/3,scale=1)/y

pllog(q=y,shape=1,scale=1/3)
qllog(p=seq(0,1,by=.25),shape=1,scale=1/3)


# }

Run the code above in your browser using DataLab