location
and scale
.
dlogis(x, location = 0, scale = 1, log = FALSE)
plogis(q, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE)
qlogis(p, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE)
rlogis(n, location = 0, scale = 1)
length(n) > 1
, the length
is taken to be the number required.dlogis
gives the density,
plogis
gives the distribution function,
qlogis
gives the quantile function, and
rlogis
generates random deviates.The length of the result is determined by n
for
rlogis
, and is the maximum of the lengths of the
numerical arguments for the other functions.The numerical arguments other than n
are recycled to the
length of the result. Only the first elements of the logical
arguments are used.
[dpq]logis
are calculated directly from the definitions. rlogis
uses inversion.location
or scale
are omitted, they assume the
default values of 0
and 1
respectively. The Logistic distribution with location
$= m$ and
scale
$= s$ 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 $m$ and variance $\pi^2 /3 s^2$.
Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 2, chapter 23. Wiley, New York.
var(rlogis(4000, 0, scale = 5)) # approximately (+/- 3)
pi^2/3 * 5^2
Run the code above in your browser using DataLab