| Logistic {base} | R Documentation |
The Logistic Distribution
Description
These functions provide information about the logistic distribution
with parameters location and scale. dlogis gives
the density, plogis gives the distribution function
qlogis gives the quantile function and rlogis generates
random deviates.
If location or scale are omitted, they assume the
default values of 0 and 1 respectively.
The Logistic distribution with location = \mu and
scale = \sigma has
distribution function
F(x) = \frac{1}{1 + e^{(x-\mu)/\sigma}}
and density
f(x)= \frac{1}{\sigma}\frac{e^{(x-\mu)/\sigma}}{(1 + e^{(x-\mu)/\sigma})^2}%
It is a long-tailed distribution with mean \mu and variance
\pi^2/3 \sigma^2.
Usage
dlogis(x, location=0, scale=1)
plogis(q, location=0, scale=1)
qlogis(p, location=0, scale=1)
rlogis(n, location=0, scale=1)
Arguments
x, q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations to generate. |
location, scale |
location and scale parameters. |
Examples
eps <- 100 * .Machine$double.eps
x <- c(0:4, rlogis(100))
all.equal(plogis(x, loc = 0), 1/(1 + exp(-x)), tol = eps)
all.equal(dlogis(x, loc = 0), exp(x) * (1 + exp(x))^-2, tol = eps)
var(rlogis(4000, 0, s = 5))# approximately (+/- 3)
pi^2/3 * 5^2