Computes the logit transformation, including its inverse.
Syntax
LOGIT(X, Lo, Hi, Return)
- X
- is the real value(s) for which we compute the transformation. It may be a single value or a one-dimensional array of cells (e.g., rows or columns)).
- Lo
- is the x-domain lower bound. If missing, Lo is assumed to be 0.
- Hi
- is the x-domain upper bound. If missing, Hi is assumed to be 1.
- Return
- is a number that determines the type of return value: 0 (or missing) = Logit, 1 = Inverse Logit.
Return Description 0 or omitted Logit Transform 1 Inverse of Logit transform
Remarks
- The X value(s) must be between Lo and Hi (exclusive).
- The original Logit function is very commonly used for parameters that lie in the unit interval. Numerical values of theta close to 0 or 1 or out of range result in #VALUE! or #N/A.
- The Logit transformation is defined as follows:
$$y=\textit{Logit}(x)=\ln{\frac{x}{1-x}}$$ And,
$$x=\textit{Logit}^{-1}(y)=\frac{e^y}{e^y+1}$$
Where:
- $x_{t}$ is the input value of the input time series at time $t$. X must be between 0 and 1, exclusive.
- $y_{t}$ is the transformed Logit value at time $t$.
- $\textit{Logit}^{-1}$ is the inverse Logit transformation.
- To support a generic interval (Lo, Hi), we perform the following mapping:
$$z=\frac{x - Lo}{Hi - Lo}$$ So, the new transform and its inverse (i.e., $\textit{Logit}^{-1}$) are defined as follows:
$$y = ln{\frac{x - Lo}{Hi - x}}$$ $$x =\textit{Logit}^{-1}(y)= \frac{Lo+Hi\times{e^y}}{1+{e^y}}$$ - In essence, the Logit converts a bounded x-range from (Lo, Hi) to $(-\infty, \infty)$:
- The Logit function accepts a single value or an array of values for X.
- The first order derivative of the Logit transform is defined as follows:
$$\frac{dy}{dx}=\frac{Hi-Lo}{({x-Lo})({Hi-x})}$$ - The first derivative is positive for all x-values in (Lo, Hi), but as x approaches Lo or Hi, the derivative goes to infinity.
Examples
Example 1:
|
|
Files Examples
Related Links
References
- John H. Aldrich, Forrest D. Nelson; Linear Probability, Logit, and Probit Models; SAGE Publications, Inc; 1st Edition(Nov 01, 1984), ISBN: 0803921330.
- Hilbe, Joseph M. (2009), Logistic Regression Models, CRC Press, p. 3, ISBN 9781420075779.
Comments
Article is closed for comments.