In statistics, the logit (logistic unit) or log-odds function is the quantile function associated with the standard logistic distribution. It has many uses in data analysis and machine learning, especially in data transformations. Mathematically, the logit is the inverse of the standard logistic function σ ( x ) = 1 / ( 1 + e − x ) {\displaystyle \textstyle \sigma (x)=1/(1+e^{-x})} , so the logit is defined as
logit p = σ − 1 ( p ) = ln p 1 − p for p ∈ ( 0 , 1 ) . {\displaystyle \operatorname {logit} p=\sigma ^{-1}(p)=\ln {\frac {p}{1-p}}\quad {\text{for}}\quad p\in (0,1).}
Because of this, the logit is also called the log-odds since it is equal to the logarithm of the odds p 1 − p {\textstyle {\frac {p}{1-p}}} where p is a probability. Thus, the logit is a type of function that maps probability values from ( 0 , 1 ) {\displaystyle (0,1)} to real numbers in ( − ∞ , + ∞ ) {\displaystyle (-\infty ,+\infty )} , akin to the probit function.
Definition If p is a probability, then p 1 − p {\textstyle {\tfrac {p}{1-p}}} is the corresponding odds; the logit of the probability is the logarithm of the odds, i.e.:
logit ( p ) = − ln ( p 1 − p ) = ln ( p ) − ln ( 1 − p ) = − ln ( 1 p − 1 ) = 2 atanh ( 2 p − 1 ) . {\displaystyle {\begin{aligned}\operatorname {logit} (p)&={\hphantom {-}}\ln \left({\frac {p}{1-p}}\right)=\ln(p)-\ln(1-p)\\&=-\ln \left({\frac {1}{p}}-1\right)=2\operatorname {atanh} (2p-1).\end{aligned}}}
The base of the logarithm function used is of little importance in the present article, as long as it is greater than 1, but the natural logarithm with base e is the one most often used. The choice of base corresponds to the choice of logarithmic unit for the value: base 2 corresponds to a shannon, base e to a nat, and base 10 to a hartley; these units are particularly used in information-theoretic interpretations. For each choice of base, the logit function takes values between negative and positive infinity. The logistic function of any number α {\displaystyle \alpha } is given by the inverse-logit:
logit − 1 ( α ) = logistic ( α ) = 1 1 + e − α = e α e α + 1 = tanh ( α 2 ) + 1 2 {\displaystyle \operatorname {logit} ^{-1}(\alpha )=\operatorname {logistic} (\alpha )={\frac {1}{1+e^{-\alpha }}}={\frac {e^{\alpha }}{e^{\alpha }+1}}={\frac {\tanh({\frac {\alpha }{2}})+1}{2}}}
The difference between the logits of two probabilities is the logarithm of the odds ratio (R), thus providing a shorthand for writing the correct combination of odds ratios only by adding and subtracting:
… excerpt ends here. Continue reading the full article.



