Ordinal regression

From HandWiki
Short description: Regression analysis for modeling ordinal data

In statistics, ordinal regression, also called ordinal classification, is a type of regression analysis used for predicting an ordinal variable, i.e. a variable whose value exists on an arbitrary scale where only the relative ordering between different values is significant. It can be considered an intermediate problem between regression and classification.[1][2] Examples of ordinal regression are ordered logit and ordered probit. Ordinal regression turns up often in the social sciences, for example in the modeling of human levels of preference (on a scale from, say, 1–5 for "very poor" through "excellent"), as well as in information retrieval. In machine learning, ordinal regression may also be called ranking learning.[3][lower-alpha 1]

Linear models for ordinal regression

Ordinal regression can be performed using a generalized linear model (GLM) that fits both a coefficient vector and a set of thresholds to a dataset. Suppose one has a set of observations, represented by length-p vectors x1 through xn, with associated responses y1 through yn, where each yi is an ordinal variable on a scale 1, ..., K. For simplicity, and without loss of generality, we assume y is a non-decreasing vector, that is, yi [math]\displaystyle{ \le }[/math] yi+1. To this data, one fits a length-p coefficient vector w and a set of thresholds θ1, ..., θK−1 with the property that θ1 < θ2 < ... < θK−1. This set of thresholds divides the real number line into K disjoint segments, corresponding to the K response levels.

The model can now be formulated as

[math]\displaystyle{ \Pr(y \le i \mid \mathbf{x}) = \sigma(\theta_i - \mathbf{w} \cdot \mathbf{x}) }[/math]

or, the cumulative probability of the response y being at most i is given by a function σ (the inverse link function) applied to a linear function of x. Several choices exist for σ; the logistic function

[math]\displaystyle{ \sigma(\theta_i - \mathbf{w} \cdot \mathbf{x}) = \frac{1}{1 + e^{-(\theta_i - \mathbf{w} \cdot \mathbf{x})}} }[/math]

gives the ordered logit model, while using the probit function gives the ordered probit model. A third option is to use an exponential function

[math]\displaystyle{ \sigma(\theta_i - \mathbf{w} \cdot \mathbf{x}) = \exp(-\exp(\theta_i - \mathbf{w} \cdot \mathbf{x})) }[/math]

which gives the proportional hazards model.[4]

Latent variable model

The probit version of the above model can be justified by assuming the existence of a real-valued latent variable (unobserved quantity) y*, determined by[5]

[math]\displaystyle{ y^* = \mathbf{w} \cdot \mathbf{x} + \varepsilon }[/math]

where ε is normally distributed with zero mean and unit variance, conditioned on x. The response variable y results from an "incomplete measurement" of y*, where one only determines the interval into which y* falls:

[math]\displaystyle{ y = \begin{cases} 1 & \text{if} ~~ y^* \le \theta_1, \\ 2 & \text{if} ~~ \theta_1 \lt y^* \le \theta_2, \\ 3 & \text{if} ~~ \theta_2 \lt y^* \le \theta_3 \\ \vdots \\ K & \text{if}~~ \theta_{K-1} \lt y^*. \end{cases} }[/math]

Defining θ0 = -∞ and θK = ∞, the above can be summarized as y = k if and only if θk−1 < y* ≤ θk.

From these assumptions, one can derive the conditional distribution of y as[5]

[math]\displaystyle{ \begin{align} P(y = k \mid \mathbf{x}) & = P(\theta_{k-1} \lt y^* \le \theta_k \mid \mathbf{x}) \\ & = P(\theta_{k-1} \lt \mathbf{w} \cdot \mathbf{x} + \varepsilon \le \theta_k) \\ & = \Phi(\theta_k - \mathbf{w} \cdot \mathbf{x}) - \Phi(\theta_{k-1} - \mathbf{w} \cdot \mathbf{x}) \end{align} }[/math]

where Φ is the cumulative distribution function of the standard normal distribution, and takes on the role of the inverse link function σ. The log-likelihood of the model for a single training example xi, yi can now be stated as[5]

[math]\displaystyle{ \log\mathcal{L}(\mathbf{w}, \mathbf{\theta} \mid \mathbf{x}_i, y_i) = \sum_{k=1}^K [y_i = k] \log [\Phi(\theta_k - \mathbf{w} \cdot \mathbf{x}_i) - \Phi(\theta_{k-1} - \mathbf{w} \cdot \mathbf{x}_i)] }[/math]

(using the Iverson bracket [yi = k].) The log-likelihood of the ordered logit model is analogous, using the logistic function instead of Φ.[6]

Alternative models

In machine learning, alternatives to the latent-variable models of ordinal regression have been proposed. An early result was PRank, a variant of the perceptron algorithm that found multiple parallel hyperplanes separating the various ranks; its output is a weight vector w and a sorted vector of K−1 thresholds θ, as in the ordered logit/probit models. The prediction rule for this model is to output the smallest rank k such that wx < θk.[7]

Other methods rely on the principle of large-margin learning that also underlies support vector machines.[8][9]

Another approach is given by Rennie and Srebro, who, realizing that "even just evaluating the likelihood of a predictor is not straight-forward" in the ordered logit and ordered probit models, propose fitting ordinal regression models by adapting common loss functions from classification (such as the hinge loss and log loss) to the ordinal case.[10]

Software

ORCA (Ordinal Regression and Classification Algorithms) is an Octave/MATLAB framework including a wide set of ordinal regression methods.[11]

R packages that provide ordinal regression methods include MASS[12] and Ordinal.[13]

See also

Notes

  1. Not to be confused with learning to rank.

References

  1. Winship, Christopher; Mare, Robert D. (1984). "Regression Models with Ordinal Variables". American Sociological Review 49 (4): 512–525. doi:10.2307/2095465. http://scholar.harvard.edu/files/cwinship/files/asr_1984.pdf. 
  2. Gutiérrez, P. A.; Pérez-Ortiz, M.; Sánchez-Monedero, J.; Fernández-Navarro, F.; Hervás-Martínez, C. (January 2016). "Ordinal Regression Methods: Survey and Experimental Study". IEEE Transactions on Knowledge and Data Engineering 28 (1): 127–146. doi:10.1109/TKDE.2015.2457911. ISSN 1041-4347. 
  3. Shashua, Amnon; Levin, Anat (2002). "Ranking with large margin principle: Two approaches". NIPS. 
  4. McCullagh, Peter (1980). "Regression models for ordinal data". Journal of the Royal Statistical Society. Series B (Methodological) 42 (2): 109–142. 
  5. 5.0 5.1 5.2 Wooldridge, Jeffrey M. (2010). Econometric Analysis of Cross Section and Panel Data. MIT Press. pp. 655–657. ISBN 9780262232586. 
  6. Agresti, Alan (23 October 2010). "Modeling Ordinal Categorical Data". http://www.stat.ufl.edu/~aa/ordinal/agresti_ordinal_tutorial.pdf. Retrieved 23 July 2015. 
  7. Crammer, Koby; Singer, Yoram (2001). "Pranking with ranking". NIPS. 
  8. Chu, Wei; Keerthi, S. Sathiya (2007). "Support vector ordinal regression". Neural Computation 19 (3): 792–815. doi:10.1162/neco.2007.19.3.792. PMID 17298234. 
  9. Herbrich, Ralf; Graepel, Thore; Obermayer, Klaus (2000). "Large Margin Rank Boundaries for Ordinal Regression". Advances in Large Margin Classifiers. MIT Press. pp. 115–132. http://research.microsoft.com/apps/pubs/default.aspx?id=65610. 
  10. Rennie, Jason D. M.; Srebro, Nathan (2005). "Loss Functions for Preference Levels: Regression with Discrete Ordered Labels". Proc. IJCAI Multidisciplinary Workshop on Advances in Preference Handling. http://ttic.uchicago.edu/~nati/Publications/RennieSrebroIJCAI05.pdf. 
  11. orca: Ordinal Regression and Classification Algorithms, AYRNA, 2017-11-21, https://github.com/ayrna/orca, retrieved 2017-11-21 
  12. "Modern Applied Statistics with S, 4th ed". http://www.stats.ox.ac.uk/pub/MASS4/. 
  13. Christensen, Rune Haubo B. (2020-06-05), runehaubo/ordinal, https://github.com/runehaubo/ordinal, retrieved 2020-07-15 

Further reading

  • Agresti, Alan (2010). Analysis of ordinal categorical data. Hoboken, N.J: Wiley. ISBN 978-0470082898. 
  • Greene, William H. (2012). Econometric Analysis (Seventh ed.). Boston: Pearson Education. pp. 824–842. ISBN 978-0-273-75356-8. 
  • Hardin, James; Hilbe, Joseph (2007). Generalized Linear Models and Extensions (2nd ed.). College Station: Stata Press. ISBN 978-1-59718-014-6.