| logit {FatTailsR} | R Documentation |
Logit and Invlogit Functions
Description
The logit and invlogit functions, widely used in this package, are wrappers
of qlogis and plogis functions.
Functions eslogis is the expected shortfall of the logistic function
(times a factor 2).
When p<=0.5, it is equivalent (times -1) to the left tail mean ltmlogis.
When p>0.5, it is equivalent to the right tail mean rtmlogis.
ltmlogis and rtmlogis are used to calculate the h parameter
in hkiener1, hkiener2, hkiener3, hkiener4.
Usage
logit(p)
invlogit(x)
ltmlogis(p, m = 0, g = 1, lower.tail = TRUE, log.p = FALSE)
rtmlogis(p, m = 0, g = 1, lower.tail = TRUE, log.p = FALSE)
eslogis(p, m = 0, g = 1, lower.tail = TRUE, log.p = FALSE)
Arguments
p |
numeric. one value or a vector between 0 and 1. |
x |
numeric. one value or a vector of numerics. |
m |
numeric. a central parameter (also used in model K1, K2, K3 and K4). |
g |
numeric. a scale parameter (also used in model K1, K2, K3 and K4). |
lower.tail |
logical. If TRUE, use p. If FALSE, use 1-p. |
log.p |
logical. If TRUE, probabilities p are given as log(p). |
Details
logit function is defined for p in (0, 1) by:
logit(p) = log( p/(1-p) )
invlogit function is defined for x in (-Inf, +Inf) by:
invlogit(x) = exp(x)/(1+exp(x)) = plogis(x)
Examples
logit( c(ppoints(11, a = 1), NA, NaN) )
invlogit( c(-Inf, -10:10, +Inf, NA, NaN) )