Logistic                package:base                R Documentation

_T_h_e _L_o_g_i_s_t_i_c _D_i_s_t_r_i_b_u_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Density, distribution function, quantile function and random
     generation for the logistic distribution with parameters
     `location' and `scale'.

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

    x, q: vector of quantiles.

       p: vector of probabilities.

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

location, scale: location and scale parameters.

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

lower.tail: logical; if TRUE (default), probabilities are P[X <= x],
          otherwise, P[X > x].

_D_e_t_a_i_l_s:

     If `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) = 1 / (1 + exp(-(x-m)/s))

     and density

            f(x) = 1/s exp((x-m)/s) (1 + exp((x-m)/s))^-2.


     It is a long-tailed distribution with mean m and variance pi^2 /3
     s^2.

_V_a_l_u_e:

     `dlogis' gives the density, `plogis' gives the distribution
     function, `qlogis' gives the quantile function, and `rlogis'
     generates random deviates.

_E_x_a_m_p_l_e_s:

     eps <- 100 * .Machine$double.eps
     x <- c(0:4, rlogis(100))
     all.equal(plogis(x),                 1 / (1 + exp(-x)), tol = eps)
     all.equal(plogis(x, lower=FALSE),   exp(-x)/ (1 + exp(-x)), tol = eps)
     all.equal(plogis(x, lower=FALSE, log=TRUE), -log(1 + exp(x)),  tol = eps)
     all.equal(dlogis(x), exp(x) * (1 + exp(x))^-2, tol = eps)

     var(rlogis(4000, 0, s = 5))# approximately (+/- 3)
     pi^2/3 * 5^2

