# Logit

In statistics, the logit (/ˈlɪt/ LOH-jit) function or the log-odds is the logarithm of the odds p/(1 − p) where p is probability. It is a type of function that creates a map of probability values from $[0,1]$ to $[-\infty ,+\infty ]$ . It is the inverse of the sigmoidal "logistic" function or logistic transform used in mathematics, especially in statistics.

In deep learning, the term logits layer is popularly used for the last neuron layer of neural networks used for classification tasks, which produce raw prediction values as real numbers ranging from $[-\infty ,+\infty ]$ .

## Definition

If p is a probability, then p/(1 − p) is the corresponding odds; the logit of the probability is the logarithm of the odds, i.e.

$\operatorname {logit} (p)=\log \left({\frac {p}{1-p}}\right)=\log(p)-\log(1-p)=-\log \left({\frac {1}{p}}-1\right).$ 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 $\alpha$ is given by the inverse-logit:

$\operatorname {logit} ^{-1}(\alpha )=\operatorname {logistic} (\alpha )={\frac {1}{1+\operatorname {exp} (-\alpha )}}={\frac {\operatorname {exp} (\alpha )}{\operatorname {exp} (\alpha )+1}}$ 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:

$\operatorname {log} (R)=\log \left({\frac {{p_{1}}/(1-p_{1})}{{p_{2}}/(1-p_{2})}}\right)=\log \left({\frac {p_{1}}{1-p_{1}}}\right)-\log \left({\frac {p_{2}}{1-p_{2}}}\right)=\operatorname {logit} (p_{1})-\operatorname {logit} (p_{2}).$ ## History

There have been several efforts to adapt linear regression methods to domain where output is probability value $[0,1]$ instead of any real number $[-\infty ,+\infty ]$ . Many of such efforts focused on modeling this problem by somehow mapping the range $[0,1]$ to $[-\infty ,+\infty ]$ and then running the linear regression on these transformed values. 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"; . However, this is computationally more expensive. In 1944, Joseph Berkson used log of odds and called this function logit, abbreviation for "logistic unit" following the analogy for probit. Log odds was used extensively by Charles Sanders Peirce (late 19th century). . G. A. Barnard in 1949 coined the commonly used term log-odds; the log-odds of an event is the logit of the probability of the event.

## Uses and properties

• The logit in logistic regression is a special case of a link function in a generalized linear model: it is the canonical link function for the Bernoulli distribution.
• The logit function is the negative of the derivative of the binary entropy function.
• The logit is also central to the probabilistic Rasch model for measurement, which has applications in psychological and educational assessment, among other areas.
• The inverse-logit function (i.e., the logistic function) is also sometimes referred to as the expit function.
• In plant disease epidemiology the logit is used to fit the data to a logistic model. With the Gompertz and Monomolecular models all three are known as Richards family models.
• The log-odds function of probabilities is often used in state estimation algorithms because of its numerical advantages in the case of small probabilities. Instead of multiplying very small floating point numbers, log-odds probabilities can just be summed up to calculate the (log-odds) joint probability.

## Comparison with probit Comparison of the logit function with a scaled probit (i.e. the inverse CDF of the normal distribution), comparing $\operatorname {logit} (x)$ vs. $\Phi ^{-1}(x)/{\sqrt {\frac {\pi }{8}}}$ , which makes the slopes the same at the y-origin.

Closely related to the logit function (and logit model) are the probit function and probit model. The logit and probit 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 logit is the quantile function of the logistic distribution, while the probit is the quantile function of the normal distribution. The probit function is denoted $\Phi ^{-1}(x)$ , where $\Phi (x)$ is the CDF of the normal distribution, as just mentioned:

$\Phi (x)={\frac {1}{\sqrt {2\pi }}}\int _{-\infty }^{x}e^{-{\frac {y^{2}}{2}}}dy.$ As shown in the graph, the logit and probit functions are extremely similar, particularly when the probit function is scaled so that its slope at y=0 matches the slope of the logit. As a result, probit models are sometimes used in place of logit models because for certain applications (e.g., in Bayesian statistics) the implementation is easier.
{"ft_lang_label":"__label__en","ft_lang_prob":0.80437654,"math_prob":0.9947895,"size":6587,"snap":"2019-26-2019-30","text_gpt3_token_len":1624,"char_repetition_ratio":0.14780495,"word_repetition_ratio":0.010721248,"special_character_ratio":0.25110066,"punctuation_ratio":0.15278901,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9998659,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"im_url_duplicate_count":[null,null,null,null,null,null,null,4,null,null,null,6,null,4,null,null,null,null,null,null,null,null,null,10,null,null,null,7,null,9,null,null,null,8,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-07-22T05:48:12Z\",\"WARC-Record-ID\":\"<urn:uuid:81daeba5-0ae4-479d-b696-7b89da87eef4>\",\"Content-Length\":\"83376\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:09f65217-94fd-4b65-985b-8d06f6379642>\",\"WARC-Concurrent-To\":\"<urn:uuid:7a19a8ce-49e1-4fd3-a27b-421ef1e89355>\",\"WARC-IP-Address\":\"208.80.154.224\",\"WARC-Target-URI\":\"https://en.wikipedia.org/wiki/Logit\",\"WARC-Payload-Digest\":\"sha1:W3L2TL44775QPTYWCVVOB2J77SM6JNBX\",\"WARC-Block-Digest\":\"sha1:LTCDC26LXWO2NWAGLRL3TZGUVBPXTFMU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-30/CC-MAIN-2019-30_segments_1563195527531.84_warc_CC-MAIN-20190722051628-20190722073628-00391.warc.gz\"}"}