is the logit function, which stretches a probability between and out onto the whole real line. It is the inverse of the logistic function and the standard tool for handling probabilities in statistics and machine learning.
The argument of the logarithm must be positive, so , giving the domain . The function tends to as and to as , so the range is all of the real numbers. Stretching an interval of width across the entire real line is exactly what this function is for.
The lines and are vertical asymptotes. Since when , the single -intercept is .
We have , so the graph has rotational symmetry about the point . In probabilistic terms, replacing an event by its complement simply flips the sign of the logit.
Writing and differentiating gives the derivative.
It is positive throughout the domain, so the function increases and has no extrema. Since is largest at , where it equals , the slope is smallest there, namely , and grows steeper toward both ends. The second derivative changes sign at , giving a single inflection point at , with the curve concave down to its left and concave up to its right.
Solving for gives and hence the following.
The inverse is therefore the logistic function, and the two graphs are reflections of each other in the line . Where the logistic squeezes the real line into , the logit pulls back out again.
Substituting into produces , so the logit equals . It is the inverse hyperbolic tangent applied after rescaling to .
The quantity is the odds corresponding to a probability , and the logit is its logarithm.
| Probability | Odds | Logit |
|---|---|---|
In logistic regression one models not the probability itself but its logit as a linear function of the predictors: the probability is constrained to lie between and , whereas the logit is unconstrained and can be treated with ordinary linear methods. The pre-activation values in a neural network are called logits for the same reason.