Jump to content

Logit

From Niidae Wiki
Revision as of 20:07, 19 May 2025 by imported>Olexa Riznyk (Improving references)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:About Template:Distinguish

File:Logit.svg
Plot of logit(x) in the domain of 0 to 1, where the base of the logarithm is e.

In statistics, the logit (Template:IPAc-en Template:Respell) 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 <math>\sigma(x) = 1/(1+e^{-x})</math>, so the logit is defined as

<math>\operatorname{logit} p = \sigma^{-1}(p) = \ln \frac{p}{1-p} \quad \text{for} \quad p \in (0,1).</math>

Because of this, the logit is also called the log-odds since it is equal to the logarithm of the odds <math>\frac{p}{1-p}</math> where Template:Mvar is a probability. Thus, the logit is a type of function that maps probability values from <math>(0, 1)</math> to real numbers in <math>(-\infty, +\infty)</math>,<ref>Template:Cite web</ref> akin to the probit function.

Definition

[edit]

If Template:Mvar is a probability, then Template:Math is the corresponding odds; the Template:Math of the probability is the logarithm of the odds, i.e.:

<math>\operatorname{logit}(p)=\ln\left( \frac{p}{1-p} \right) =\ln(p)-\ln(1-p)=-\ln\left( \frac{1}{p}-1\right)=2\operatorname{atanh}(2p-1). </math>

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 Template:Mvar 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 Template:Mvar 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 <math>\alpha</math> is given by the inverse-Template:Math:

<math>\operatorname{logit}^{-1}(\alpha) = \operatorname{logistic}(\alpha) = \frac{1}{1 + \exp(-\alpha)} = \frac{\exp(\alpha)}{ \exp(\alpha) + 1} = \frac{\tanh(\frac{\alpha}{2})+1}{2}</math>

The difference between the Template:Maths of two probabilities is the logarithm of the odds ratio (Template:Mvar), thus providing a shorthand for writing the correct combination of odds ratios only by adding and subtracting:

<math>\ln(R)=\ln\left( \frac{p_1/(1-p_1)}{p_2/(1-p_2)} \right) =\ln\left( \frac{p_1}{1-p_1} \right) - \ln\left(\frac{p_2}{1-p_2}\right) = \operatorname{logit}(p_1)-\operatorname{logit}(p_2)\,.</math>

The Taylor series for the logit function is given by:

<math>\operatorname{logit}(x)=2\sum_{n=0}^\infty \frac{(2x-1)^{2n+1}}{2n+1}.</math>

History

[edit]

Several approaches have been explored to adapt linear regression methods to a domain where the output is a probability value <math>(0, 1)</math>, instead of any real number <math>(-\infty, +\infty)</math>. In many cases, such efforts have focused on modeling this problem by mapping the range <math>(0, 1)</math> to <math>(-\infty, +\infty)</math> and then running the linear regression on these transformed values.<ref name="Cramer2003"/>

In 1934, Chester Ittner Bliss used the cumulative normal distribution function to perform this mapping and called his model probit, an abbreviation for "probability unit". This is, however, computationally more expensive.<ref name="Cramer2003">Template:Cite web</ref>

In 1944, Joseph Berkson used log of odds and called this function logit, an abbreviation for "logistic unit", following the analogy for probit: Template:Quote

Log odds was used extensively by Charles Sanders Peirce (late 19th century).<ref>Template:Cite book</ref> G. A. Barnard in 1949 coined the commonly used term log-odds;<ref>Template:Citation.</ref>Template:Sfn the log-odds of an event is the logit of the probability of the event.<ref>Template:Citation.</ref> Barnard also coined the term lods as an abstract form of "log-odds",Template:Sfn but suggested that "in practice the term 'odds' should normally be used, since this is more familiar in everyday life".Template:Sfn

Uses and properties

[edit]

Comparison with probit

[edit]
File:Logit-probit.svg
Comparison of the logit function with a scaled probit (i.e. the inverse CDF of the normal distribution), comparing <math>\operatorname{logit}(x)</math> vs. <math>\tfrac{\Phi^{-1}(x)}{\,\sqrt{\pi/8\,}\,}</math>, which makes the slopes the same at the Template:Mvar-origin.

Closely related to the Template:Math function (and logit model) are the probit function and probit model. The Template:Math and Template:Math are both sigmoid functions with a domain between 0 and 1, which makes them both quantile functions – i.e., inverses of the cumulative distribution function (CDF) of a probability distribution. In fact, the Template:Math is the quantile function of the logistic distribution, while the Template:Math is the quantile function of the normal distribution. The Template:Math function is denoted <math>\Phi^{-1}(x)</math>, where <math>\Phi(x)</math> is the CDF of the standard normal distribution, as just mentioned:

<math>\Phi(x) = \frac 1 {\sqrt{2\pi}}\int_{-\infty}^x e^{-y^2/2} dy.</math>

As shown in the graph on the right, the Template:Math and Template:Math functions are extremely similar when the Template:Math function is scaled, so that its slope at Template:Math matches the slope of the Template:Math. As a result, probit models are sometimes used in place of logit models because for certain applications (e.g., in item response theory) the implementation is easier.<ref>Template:Cite book</ref>

See also

[edit]

References

[edit]

Template:More footnotes needed

Template:Reflist Template:Refbegin

Template:Refend

[edit]

Further reading

[edit]