Linear discriminant analysis (LDA), normal discriminant analysis (NDA), or discriminant function analysis is a generalization of Fisher's linear discriminant, a method used in statistics and other fields, to find a linear combination of features that characterizes or separates two or more classes of objects or events. The resulting combination may be used as a linear classifier, or, more commonly, for dimensionality reduction before later classification.
LDA is closely related to analysis of variance (ANOVA) and regression analysis, which also attempt to express one dependent variable as a linear combination of other features or measurements.[1] [2] However, ANOVA uses categorical independent variables and a continuous dependent variable, whereas discriminant analysis has continuous independent variables and a categorical dependent variable (i.e. the class label).[3] Logistic regression and probit regression are more similar to LDA than ANOVA is, as they also explain a categorical variable by the values of continuous independent variables. These other methods are preferable in applications where it is not reasonable to assume that the independent variables are normally distributed, which is a fundamental assumption of the LDA method.
LDA is also closely related to principal component analysis (PCA) and factor analysis in that they both look for linear combinations of variables which best explain the data.[4] LDA explicitly attempts to model the difference between the classes of data. PCA, in contrast, does not take into account any difference in class, and factor analysis builds the feature combinations based on differences rather than similarities. Discriminant analysis is also different from factor analysis in that it is not an interdependence technique: a distinction between independent variables and dependent variables (also called criterion variables) must be made.
LDA works when the measurements made on independent variables for each observation are continuous quantities. When dealing with categorical independent variables, the equivalent technique is discriminant correspondence analysis.[5] [6]
Discriminant analysis is used when groups are known a priori (unlike in cluster analysis). Each case must have a score on one or more quantitative predictor measures, and a score on a group measure.[7] In simple terms, discriminant function analysis is classification - the act of distributing things into groups, classes or categories of the same type.
The original dichotomous discriminant analysis was developed by Sir Ronald Fisher in 1936.[8] It is different from an ANOVA or MANOVA, which is used to predict one (ANOVA) or multiple (MANOVA) continuous dependent variables by one or more independent categorical variables. Discriminant function analysis is useful in determining whether a set of variables is effective in predicting category membership.[9]
Consider a set of observations
{\vecx}
y
y
\vecx
LDA approaches the problem by assuming that the conditional probability density functions
p(\vecx|y=0)
p(\vecx|y=1)
\left(\vec\mu0,\Sigma0\right)
\left(\vec\mu1,\Sigma1\right)
1 | |
2 |
(\vecx-\vec
T | |
\mu | |
0) |
-1 | |
\Sigma | |
0 |
(\vecx-\vec\mu0)+
1 | |
2 |
ln|\Sigma0|-
1 | |
2 |
(\vecx-\vec
T | |
\mu | |
1) |
-1 | |
\Sigma | |
1 |
(\vecx-\vec\mu1)-
1 | |
2 |
ln|\Sigma1| > T
Without any further assumptions, the resulting classifier is referred to as quadratic discriminant analysis (QDA).
LDA instead makes the additional simplifying homoscedasticity assumption (i.e. that the class covariances are identical, so
\Sigma0=\Sigma1=\Sigma
{\vecx}T
-1 | |
\Sigma | |
0 |
\vecx={\vecx}T
-1 | |
\Sigma | |
1 |
\vecx
{\vecx}T
-1 | |
{\Sigma | |
i} |
\vec{\mu}i=
-1 | |
{\vec{\mu} | |
i} |
\vecx
\Sigmai
and the above decision criterionbecomes a threshold on the dot product
{\vecw}T\vecx>c
for some threshold constant c, where
\vecw=\Sigma-1(\vec\mu1-\vec\mu0)
c=
12 | |
{\vecw}T(\vec\mu1+\vec\mu0)
This means that the criterion of an input
\vec{x}
y
It is often useful to see this conclusion in geometrical terms: the criterion of an input
\vec{x}
y
\vec{x}
\vec{w}
y
\vec{x}
\vec{w}
c
The assumptions of discriminant analysis are the same as those for MANOVA. The analysis is quite sensitive to outliers and the size of the smallest group must be larger than the number of predictor variables.[7]
Independent variables are normal for each level of the grouping variable.[9] [7]
Participants are assumed to be randomly sampled, and a participant's score on one variable is assumed to be independent of scores on that variable for all other participants.[9] [7]
It has been suggested that discriminant analysis is relatively robust to slight violations of these assumptions,[11] and it has also been shown that discriminant analysis may still be reliable when using dichotomous variables (where multivariate normality is often violated).[12]
Discriminant analysis works by creating one or more linear combinations of predictors, creating a new latent variable for each function. These functions are called discriminant functions. The number of functions possible is either
Ng-1
Ng
p
Given group
j
Rj
x\inRj
x\inj
Rj
Each function is given a discriminant score to determine how well it predicts group placement.
Assigns
x
x
\piifi(x)
fi(x)
Maximizes the ratio between SSbetween and SSwithin, and finds a linear combination of the predictors to predict group.[15]
An eigenvalue in discriminant analysis is the characteristic root of each function. It is an indication of how well that function differentiates the groups, where the larger the eigenvalue, the better the function differentiates.[7] This however, should be interpreted with caution, as eigenvalues have no upper limit.[9] [7] The eigenvalue can be viewed as a ratio of SSbetween and SSwithin as in ANOVA when the dependent variable is the discriminant function, and the groups are the levels of the IV.[9] This means that the largest eigenvalue is associated with the first function, the second largest with the second, etc..
Some suggest the use of eigenvalues as effect size measures, however, this is generally not supported.[9] Instead, the canonical correlation is the preferred measure of effect size. It is similar to the eigenvalue, but is the square root of the ratio of SSbetween and SStotal. It is the correlation between groups and the function.[9] Another popular measure of effect size is the percent of variance for each function. This is calculated by: (λx/Σλi) X 100 where λx is the eigenvalue for the function and Σλi is the sum of all eigenvalues. This tells us how strong the prediction is for that particular function compared to the others.[9] Percent correctly classified can also be analyzed as an effect size. The kappa value can describe this while correcting for chance agreement.[9] [16]
Canonical discriminant analysis (CDA) finds axes (k − 1 canonical coordinates, k being the number of classes) that best separate the categories. These linear functions are uncorrelated and define, in effect, an optimal k − 1 space through the n-dimensional cloud of data that best separates (the projections in that space of) the k groups. See “Multiclass LDA” for details below.
The terms Fisher's linear discriminant and LDA are often used interchangeably, although Fisher's original article actually describes a slightly different discriminant, which does not make some of the assumptions of LDA such as normally distributed classes or equal class covariances.
Suppose two classes of observations have means
\vec\mu0,\vec\mu1
\Sigma0,\Sigma1
{\vecw}T\vecx
{\vecw}T\vec\mui
{\vecw}T\Sigmai\vecw
i=0,1
S= |
| ||||||
|
=
| |||||||||
{\vecw |
T\Sigma1\vecw+{\vecw}T\Sigma0\vecw}=
| |||||||||
{\vecw |
T(\Sigma0+\Sigma1)\vecw}
This measure is, in some sense, a measure of the signal-to-noise ratio for the class labelling. It can be shown that the maximum separation occurs when
\vecw\propto(\Sigma0+\Sigma
-1 | |
1) |
(\vec\mu1-\vec\mu0)
When the assumptions of LDA are satisfied, the above equation is equivalent to LDA.Be sure to note that the vector
\vecw
\vecw
Generally, the data points to be discriminated are projected onto
\vecw
\vecw ⋅ \vec\mu0
\vecw ⋅ \vec\mu1
\vecw ⋅ \vecx>c
c=\vecw ⋅
12 | |
(\vec |
\mu0+\vec\mu1)=
1 | |
2 |
T | |
\vec\mu | |
1 |
-1 | |
\Sigma | |
1 |
\vec\mu1-
1 | |
2 |
T | |
\vec\mu | |
0 |
-1 | |
\Sigma | |
0 |
\vec\mu0
Otsu's method is related to Fisher's linear discriminant, and was created to binarize the histogram of pixels in a grayscale image by optimally picking the black/white threshold that minimizes intra-class variance and maximizes inter-class variance within/between grayscales assigned to black and white pixel classes.
In the case where there are more than two classes, the analysis used in the derivation of the Fisher discriminant can be extended to find a subspace which appears to contain all of the class variability.[17] This generalization is due to C. R. Rao.[18] Suppose that each of C classes has a mean
\mui
\Sigma
\Sigmab=
1 | |
C |
C | |
\sum | |
i=1 |
(\mui-\mu)
T | |
(\mu | |
i-\mu) |
where
\mu
\vecw
S=
{\vecw | |
T |
\Sigmab\vecw}{{\vecw}T\Sigma\vecw}
This means that when
\vecw
\Sigma-1\Sigmab
If
\Sigma-1\Sigmab
\Sigmab
If classification is required, instead of dimension reduction, there are a number of alternative techniques available. For instance, the classes may be partitioned, and a standard Fisher discriminant or LDA used to classify each partition. A common example of this is "one against the rest" where the points from one class are put in one group, and everything else in the other, and then LDA applied. This will result in C classifiers, whose results are combined. Another commonmethod is pairwise classification, where a new classifier is created for each pair of classes (giving C(C − 1)/2 classifiers in total), with the individual classifiers combined to produce a final classification.
The typical implementation of the LDA technique requires that all the samples are available in advance. However, there are situations where the entire data set is not available and the input data are observed as a stream. In this case, it is desirable for the LDA feature extraction to have the ability to update the computed LDA features by observing the new samples without running the algorithm on the whole data set. For example, in many real-time applications such as mobile robotics or on-line face recognition, it is important to update the extracted LDA features as soon as new observations are available. An LDA feature extraction technique that can update the LDA features by simply observing new samples is an incremental LDA algorithm, and this idea has been extensively studied over the last two decades.[19] Chatterjee and Roychowdhury proposed an incremental self-organized LDA algorithm for updating the LDA features.[20] In other work, Demir and Ozmehmet proposed online local learning algorithms for updating LDA features incrementally using error-correcting and the Hebbian learning rules.[21] Later, Aliyari et al. derived fast incremental algorithms to update the LDA features by observing the new samples.
In practice, the class means and covariances are not known. They can, however, be estimated from the training set. Either the maximum likelihood estimate or the maximum a posteriori estimate may be used in place of the exact value in the above equations. Although the estimates of the covariance may be considered optimal in some sense, this does not mean that the resulting discriminant obtained by substituting these values is optimal in any sense, even if the assumption of normally distributed classes is correct.
Another complication in applying LDA and Fisher's discriminant to real data occurs when the number of measurements of each sample (i.e., the dimensionality of each data vector) exceeds the number of samples in each class. In this case, the covariance estimates do not have full rank, and so cannot be inverted. There are a number of ways to deal with this. One is to use a pseudo inverse instead of the usual matrix inverse in the above formulae. However, better numeric stability may be achieved by first projecting the problem onto the subspace spanned by
\Sigmab
\Sigma=(1-λ)\Sigma+λI
where
I
λ
Also, in many practical cases linear discriminants are not suitable. LDA and Fisher's discriminant can be extended for use in non-linear classification via the kernel trick. Here, the original observations are effectively mapped into a higher dimensional non-linear space. Linear classification in this non-linear space is then equivalent to non-linear classification in the original space. The most commonly used example of this is the kernel Fisher discriminant.
LDA can be generalized to multiple discriminant analysis, where c becomes a categorical variable with N possible states, instead of only two. Analogously, if the class-conditional densities
p(\vecx\midc=i)
P(c\mid\vecx)
In addition to the examples given below, LDA is applied in positioning and product management.
In bankruptcy prediction based on accounting ratios and other financial variables, linear discriminant analysis was the first statistical method applied to systematically explain which firms entered bankruptcy vs. survived. Despite limitations including known nonconformance of accounting ratios to the normal distribution assumptions of LDA, Edward Altman's 1968 model[25] is still a leading model in practical applications.[26] [27] [28]
In computerised face recognition, each face is represented by a large number of pixel values. Linear discriminant analysis is primarily used here to reduce the number of features to a more manageable number before classification. Each of the new dimensions is a linear combination of pixel values, which form a template. The linear combinations obtained using Fisher's linear discriminant are called Fisher faces, while those obtained using the related principal component analysis are called eigenfaces.
In marketing, discriminant analysis was once often used to determine the factors which distinguish different types of customers and/or products on the basis of surveys or other forms of collected data. Logistic regression or other methods are now more commonly used. The use of discriminant analysis in marketing can be described by the following steps:
The main application of discriminant analysis in medicine is the assessment of severity state of a patient and prognosis of disease outcome. For example, during retrospective analysis, patients are divided into groups according to severity of disease – mild, moderate, and severe form. Then results of clinical and laboratory analyses are studied to reveal statistically different variables in these groups. Using these variables, discriminant functions are built to classify disease severity in future patients. Additionally, Linear Discriminant Analysis (LDA) can help select more discriminative samples for data augmentation, improving classification performance.[29]
In biology, similar principles are used in order to classify and define groups of different biological objects, for example, to define phage types of Salmonella enteritidis based on Fourier transform infrared spectra,[30] to detect animal source of Escherichia coli studying its virulence factors[31] etc.
This method can be used to . For example, when different data from various zones are available, discriminant analysis can find the pattern within the data and classify it effectively.[32]
Discriminant function analysis is very similar to logistic regression, and both can be used to answer the same research questions.[9] Logistic regression does not have as many assumptions and restrictions as discriminant analysis. However, when discriminant analysis’ assumptions are met, it is more powerful than logistic regression.[33] Unlike logistic regression, discriminant analysis can be used with small sample sizes. It has been shown that when sample sizes are equal, and homogeneity of variance/covariance holds, discriminant analysis is more accurate.[7] Despite all these advantages, logistic regression has none-the-less become the common choice, since the assumptions of discriminant analysis are rarely met.[8] [7]
Geometric anomalies in higher dimensions lead to the well-known curse of dimensionality. Nevertheless, proper utilization of concentration of measure phenomena can make computation easier.[34] An important case of these blessing of dimensionality phenomena was highlighted by Donoho and Tanner: if a sample is essentially high-dimensional then each point can be separated from the rest of the sample by linear inequality, with high probability, even for exponentially large samples.[35] These linear inequalities can be selected in the standard (Fisher's) form of the linear discriminant for a rich family of probability distribution.[36] In particular, such theorems are proven for log-concave distributions including multidimensional normal distribution (the proof is based on the concentration inequalities for log-concave measures[37]) and for product measures on a multidimensional cube (this is proven using Talagrand's concentration inequality for product probability spaces). Data separability by classical linear discriminants simplifies the problem of error correction for artificial intelligence systems in high dimension.[38]