Hubbry Logo
Linear discriminant analysisLinear discriminant analysisMain
Open search
Linear discriminant analysis
Community hub
Linear discriminant analysis
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Linear discriminant analysis
Linear discriminant analysis
from Wikipedia
Linear discriminant analysis on a two dimensional space with two classes. The Bayes boundary is calculated based on the true data generation parameters, the estimated boundary on the realised data points.[1]
Linear discriminant analysis animation. Given a dataset with two labels, the dataset is projected to a line. The optimal projection is obtained when the ratio of (between-class variance)/(within-class variance) is maximized.

Linear discriminant analysis (LDA), normal discriminant analysis (NDA), canonical variates analysis (CVA), 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.[2][3] 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).[4] 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.[5] 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.[6][7]

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.[8] In simple terms, discriminant function analysis is classification - the act of distributing things into groups, classes or categories of the same type.

History

[edit]

The original dichotomous discriminant analysis was developed by Sir Ronald Fisher in 1936.[9] 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.[10]

LDA for two classes

[edit]

Consider a set of observations (also called features, attributes, variables or measurements) for each sample of an object or event with known class . This set of samples is called the training set in a supervised learning context. The classification problem is then to find a good predictor for the class of any sample of the same distribution (not necessarily from the training set) given only an observation .[11]: 338 

LDA approaches the problem by assuming that the conditional probability density functions and are both the normal distribution with mean and covariance parameters and , respectively. Under this assumption, the Bayes-optimal solution is to predict points as being from the second class if the log of the likelihood ratios is bigger than some threshold T, so that:

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 ) and that the covariances have full rank. In this case, several terms cancel:

because both sides are scalar and transpose to each other ( is Hermitian)

and the above decision criterion becomes a threshold on the dot product

for some threshold constant c, where

This means that the criterion of an input being in a class is purely a function of this linear combination of the known observations.

It is often useful to see this conclusion in geometrical terms: the criterion of an input being in a class is purely a function of projection of multidimensional-space point onto vector (thus, we only consider its direction). In other words, the observation belongs to if corresponding is located on a certain side of a hyperplane perpendicular to . The location of the plane is defined by the threshold .

Assumptions

[edit]

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.[8]

  • Multivariate normality: Independent variables are normal for each level of the grouping variable.[10][8]
  • Homogeneity of variance/covariance (homoscedasticity): Variances among group variables are the same across levels of predictors. Can be tested with Box's M statistic.[10] It has been suggested, however, that linear discriminant analysis be used when covariances are equal, and that quadratic discriminant analysis may be used when covariances are not equal.[8]
  • Independence: 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.[10][8]

It has been suggested that discriminant analysis is relatively robust to slight violations of these assumptions,[12] and it has also been shown that discriminant analysis may still be reliable when using dichotomous variables (where multivariate normality is often violated).[13]

Discriminant functions

[edit]

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 where = number of groups, or (the number of predictors), whichever is smaller. The first function created maximizes the differences between groups on that function. The second function maximizes differences on that function, but also must not be correlated with the previous function. This continues with subsequent functions with the requirement that the new function not be correlated with any of the previous functions.

Given group , with sets of sample space, there is a discriminant rule such that if , then . Discriminant analysis then, finds “good” regions of to minimize classification error, therefore leading to a high percent correct classified in the classification table.[14]

Each function is given a discriminant score[clarification needed] to determine how well it predicts group placement.

  • Structure Correlation Coefficients: The correlation between each predictor and the discriminant score of each function. This is a zero-order correlation (i.e., not corrected for the other predictors).[15]
  • Standardized Coefficients: Each predictor's weight in the linear combination that is the discriminant function. Like in a regression equation, these coefficients are partial (i.e., corrected for the other predictors). Indicates the unique contribution of each predictor in predicting group assignment.
  • Functions at Group Centroids: Mean discriminant scores for each grouping variable are given for each function. The farther apart the means are, the less error there will be in classification.

Discrimination rules

[edit]
  • Maximum likelihood: Assigns to the group that maximizes population (group) density.[16]
  • Bayes Discriminant Rule: Assigns to the group that maximizes , where πi represents the prior probability of that classification, and represents the population density.[16]
  • Fisher's linear discriminant rule: Maximizes the ratio between SSbetween and SSwithin, and finds a linear combination of the predictors to predict group.[16]

Eigenvalues

[edit]

An eigenvalue in discriminant analysis is the characteristic root of each function.[clarification needed] It is an indication of how well that function differentiates the groups, where the larger the eigenvalue, the better the function differentiates.[8] This however, should be interpreted with caution, as eigenvalues have no upper limit.[10][8] 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[clarification needed].[10] This means that the largest eigenvalue is associated with the first function, the second largest with the second, etc..

Effect size

[edit]

Some suggest the use of eigenvalues as effect size measures, however, this is generally not supported.[10] 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.[10] Another popular measure of effect size is the percent of variance[clarification needed] 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.[10] Percent correctly classified can also be analyzed as an effect size. The kappa value can describe this while correcting for chance agreement.[10]Kappa normalizes across all categorizes rather than biased by a significantly good or poorly performing classes.[clarification needed][17]

Canonical discriminant analysis for k classes

[edit]

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.

Because LDA uses canonical variates, it was initially often referred as the "method of canonical variates"[18] or canonical variates analysis (CVA).[19]

Fisher's linear discriminant

[edit]

The terms Fisher's linear discriminant and LDA are often used interchangeably, although Fisher's original article[2] 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 and covariances . Then the linear combination of features will have means and variances for . Fisher defined the separation between these two distributions to be the ratio of the variance between the classes to the variance within the classes:

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

When the assumptions of LDA are satisfied, the above equation is equivalent to LDA.

Fisher's Linear Discriminant visualised as an axis

Be sure to note that the vector is the normal to the discriminant hyperplane. As an example, in a two dimensional problem, the line that best divides the two groups is perpendicular to .

Generally, the data points to be discriminated are projected onto ; then the threshold that best separates the data is chosen from analysis of the one-dimensional distribution. There is no general rule for the threshold. However, if projections of points from both classes exhibit approximately the same distributions, a good choice would be the hyperplane between projections of the two means, and . In this case the parameter c in threshold condition can be found explicitly:

.

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.

Multiclass LDA

[edit]
Visualisation for one-versus-all LDA axes for 4 classes in 3d
Projections along linear discriminant axes for 4 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.[20] This generalization is due to C. R. Rao.[21] Suppose that each of C classes has a mean and the same covariance . Then the scatter between class variability may be defined by the sample covariance of the class means

where is the mean of the class means. The class separation in a direction in this case will be given by

This means that when is an eigenvector of the separation will be equal to the corresponding eigenvalue.

If is diagonalizable, the variability between features will be contained in the subspace spanned by the eigenvectors corresponding to the C − 1 largest eigenvalues (since is of rank C − 1 at most). These eigenvectors are primarily used in feature reduction, as in PCA. The eigenvectors corresponding to the smaller eigenvalues will tend to be very sensitive to the exact choice of training data, and it is often necessary to use regularisation as described in the next section.

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 common method 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.

Incremental LDA

[edit]

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.[22] Chatterjee and Roychowdhury proposed an incremental self-organized LDA algorithm for updating the LDA features.[23] In other work, Demir and Ozmehmet proposed online local learning algorithms for updating LDA features incrementally using error-correcting and the Hebbian learning rules.[24] Later, Aliyari et al. derived fast incremental algorithms to update the LDA features by observing the new samples.[22]

Practical use

[edit]

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.[5] 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 .[25] Another strategy to deal with small sample size is to use a shrinkage estimator of the covariance matrix, which can be expressed mathematically as

where is the identity matrix, and is the shrinkage intensity or regularisation parameter. This leads to the framework of regularized discriminant analysis[26] or shrinkage discriminant analysis.[27]

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 are normal with shared covariances, the sufficient statistic for are the values of N projections, which are the subspace spanned by the N means, affine projected by the inverse covariance matrix. These projections can be found by solving a generalized eigenvalue problem, where the numerator is the covariance matrix formed by treating the means as the samples, and the denominator is the shared covariance matrix. See “Multiclass LDA” above for details.

Applications

[edit]

In addition to the examples given below, LDA is applied in positioning and product management.

Bankruptcy prediction

[edit]

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[28] is still a leading model in practical applications.[29][30][31]

Face recognition

[edit]

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.

Marketing

[edit]

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:

  1. Formulate the problem and gather data—Identify the salient attributes consumers use to evaluate products in this category—Use quantitative marketing research techniques (such as surveys) to collect data from a sample of potential customers concerning their ratings of all the product attributes. The data collection stage is usually done by marketing research professionals. Survey questions ask the respondent to rate a product from one to five (or 1 to 7, or 1 to 10) on a range of attributes chosen by the researcher. Anywhere from five to twenty attributes are chosen. They could include things like: ease of use, weight, accuracy, durability, colourfulness, price, or size. The attributes chosen will vary depending on the product being studied. The same question is asked about all the products in the study. The data for multiple products is codified and input into a statistical program such as R, SPSS or SAS. (This step is the same as in Factor analysis).
  2. Estimate the Discriminant Function Coefficients and determine the statistical significance and validity—Choose the appropriate discriminant analysis method. The direct method involves estimating the discriminant function so that all the predictors are assessed simultaneously. The stepwise method enters the predictors sequentially. The two-group method should be used when the dependent variable has two categories or states. The multiple discriminant method is used when the dependent variable has three or more categorical states. Use Wilks's Lambda to test for significance in SPSS or F stat in SAS. The most common method used to test validity is to split the sample into an estimation or analysis sample, and a validation or holdout sample. The estimation sample is used in constructing the discriminant function. The validation sample is used to construct a classification matrix which contains the number of correctly classified and incorrectly classified cases. The percentage of correctly classified cases is called the hit ratio.
  3. Plot the results on a two dimensional map, define the dimensions, and interpret the results. The statistical program (or a related module) will map the results. The map will plot each product (usually in two-dimensional space). The distance of products to each other indicate either how different they are. The dimensions must be labelled by the researcher. This requires subjective judgement and is often very challenging. See perceptual mapping.

Biomedical studies

[edit]

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.[32]

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,[33] to detect animal source of Escherichia coli studying its virulence factors[34] etc.

Earth science

[edit]

This method can be used to separate the alteration zones[clarification needed]. For example, when different data from various zones are available, discriminant analysis can find the pattern within the data and classify it effectively.[35]

Comparison to logistic regression

[edit]

Discriminant function analysis is very similar to logistic regression, and both can be used to answer the same research questions.[10] 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.[36] 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.[8] Despite all these advantages, logistic regression has none-the-less become the common choice, since the assumptions of discriminant analysis are rarely met.[9][8]

Linear discriminant in high dimensions

[edit]

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.[37] 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.[38] These linear inequalities can be selected in the standard (Fisher's) form of the linear discriminant for a rich family of probability distribution.[39] 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[40]) 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.[41]

See also

[edit]

References

[edit]

Further reading

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Linear discriminant analysis (LDA) is a supervised statistical method for and that projects high-dimensional data onto a lower-dimensional space to maximize the separation between multiple classes while minimizing the variance within each class. It assumes that the features within each class are drawn from multivariate normal distributions with class-specific means but a shared across all classes. Originally developed for taxonomic using multiple measurements, LDA finds linear combinations of input variables—known as discriminant functions—that best distinguish between predefined groups. Introduced by British statistician Ronald A. Fisher in his 1936 paper "The Use of Multiple Measurements in Taxonomic Problems," LDA was initially applied to discriminate between species of iris flowers based on and dimensions. Fisher's approach maximized the ratio of between-class variance to within-class variance, providing a criterion for optimal linear separation that remains foundational today. Over the decades, LDA has evolved into a cornerstone of and , with extensions addressing high-dimensional data and relaxed assumptions, such as quadratic discriminant analysis for unequal covariances. In practice, LDA computes the discriminant score for a new observation as a linear function of its features, weighted by the inverse of the pooled covariance matrix and the differences in class means, then assigns it to the class yielding the highest posterior probability. This generative model is particularly effective for datasets where classes are linearly separable and sample sizes exceed the number of features, though it can suffer from overfitting in high dimensions without regularization. Applications span diverse fields, including biomedical diagnostics for classifying patient outcomes, face recognition in computer vision, and financial modeling for credit risk assessment, owing to its interpretability and computational efficiency.

Historical Development

Origins in Statistics

The origins of linear discriminant analysis lie in early efforts to separate groups using linear combinations of multiple variables, rooted in biometric and anthropological applications. Karl Pearson laid foundational concepts in multivariate analysis through his 1901 development of principal components analysis, published in the Philosophical Magazine, which involved constructing linear combinations of variables to best represent systems of points in multivariate space. This work provided tools for dimensionality reduction that later influenced discriminant methods. In the 1920s, Pearson extended these ideas with the coefficient of racial likeness, a statistical measure designed to quantify differences between populations using linear functions of correlated variables, particularly for classifying groups from physical traits such as cranial indices. Concurrently, contributed to discriminant concepts through his development of distance measures in anthropometric studies, starting around 1920 with analyses of race mixture in , which accounted for variable correlations to better separate ethnic groups. These pre-Fisher innovations found practical use in and for species classification, where linear separators based on multivariate measurements—such as skull dimensions or body proportions—were employed to distinguish human races or animal taxa without rules. Such applications highlighted the utility of linear methods for group discrimination in empirical sciences. This statistical groundwork set the stage for Fisher's 1936 formalization of the technique.

Key Contributions and Evolution

introduced linear discriminant analysis in his seminal 1936 paper, where he proposed a method to find a of multiple measurements that maximizes the separation between taxonomic groups, specifically applied to classifying three of iris flowers using four morphological features: sepal length, sepal width, petal length, and petal width. This approach, known as Fisher's linear , derived coefficients for a discriminant function that achieved perfect separation in the between and , with no overlap in the projected values across the 50 samples per , demonstrating the method's efficacy for distinguishing populations with multivariate normal distributions. Following , C. Radhakrishna Rao advanced the theoretical foundations in 1948 by generalizing Fisher's discriminant criterion to multiple populations and linking it to canonical correlations, providing a unified framework for biological classification problems through the maximization of between-group variance relative to within-group variance. Rao's criterion, which involves solving a generalized eigenvalue problem, extended the method's applicability beyond binary cases and established connections to multivariate analysis techniques, influencing subsequent developments in statistical discrimination. In the 1970s and , computational advancements made eigenvalue-based solutions for linear discriminant analysis more tractable, building on Harold Hotelling's earlier contributions to multivariate analysis, including his 1936 introduction of that provided the mathematical basis for extracting discriminant directions via eigenvalue decomposition. These methods gained practical utility with improved computing resources, enabling efficient implementation of the generalized eigenvalue problem central to LDA for high-dimensional data. Modern milestones in the integrated linear discriminant analysis into , notably through Belhumeur et al.'s 1997 work applying it to face recognition, where "Fisherfaces" outperformed by projecting data onto class-specific directions that enhance separability under varying illumination and pose. In the 2000s, online variants emerged for , such as Pang et al.'s 2005 incremental linear discriminant analysis, which updates the discriminant subspace efficiently as new data arrives without full recomputation, addressing concept drift in dynamic environments like sensor networks. Since the 2010s, LDA has been extended in kernel and frameworks, incorporating nonlinear mappings and neural architectures for improved performance on complex datasets as of 2025.

Fundamental Principles

Core Assumptions

Linear discriminant analysis (LDA) relies on several key statistical assumptions to ensure the validity of its discriminant functions and classification boundaries. Central to the method is the assumption that the observations within each class are independently and identically distributed (i.i.d.), which underpins the probabilistic framework for separating classes based on linear combinations of features. This independence allows the log-posterior ratio between classes to exhibit linearity, facilitating optimal separation along linear decision boundaries when the other distributional assumptions hold. A foundational assumption is multivariate normality for each class: the feature vectors x\mathbf{x} for class kk are drawn from a multivariate Gaussian distribution N(μk,Σ)\mathcal{N}(\boldsymbol{\mu}_k, \boldsymbol{\Sigma}), where μk\boldsymbol{\mu}_k is the class-specific mean vector. Additionally, LDA assumes homoscedasticity, meaning the covariance matrix Σ\boldsymbol{\Sigma} is identical across all classes (Σ1=Σ2==ΣK\boldsymbol{\Sigma}_1 = \boldsymbol{\Sigma}_2 = \dots = \boldsymbol{\Sigma}_K), which simplifies the decision rule to a and avoids the need for class-specific quadratic terms. These normality and equal assumptions enable the derivation of maximum likelihood estimates for the parameters and ensure that the method achieves the Bayes optimal classifier under the model. The model also incorporates prior probabilities πk\pi_k for each class kk, representing the relative frequency of occurrence in the ; these are often assumed equal (πk=1/K\pi_k = 1/K) unless suggests otherwise, such as through sample proportions. Violations of these assumptions can compromise performance: for instance, heteroscedasticity (unequal s) introduces in boundary estimation, prompting the use of quadratic discriminant analysis (QDA) as an alternative that relaxes the equal constraint. In high-dimensional settings where the number of features exceeds the sample size, the normality assumption may lead to or biased estimates, reducing the method's reliability unless regularized variants are employed.

Binary Classification Framework

Linear discriminant analysis in the framework addresses the problem of distinguishing between two classes, typically labeled as class 0 and class 1, where the data from each class is assumed to follow a with respective means μ0\mu_0 and μ1\mu_1, and a shared Σ\Sigma. The objective is to derive a linear projection that maximizes the separation between the projected class means while minimizing the within-class variability, thereby facilitating effective classification in a lower-dimensional space. The core mechanism relies on Fisher's criterion, which seeks to maximize the ratio of between-class scatter to within-class scatter for a projection vector ww. This is formalized as the objective function J(w)=wTSBwwTSWw,J(w) = \frac{w^T S_B w}{w^T S_W w}, where SB=(μ1μ0)(μ1μ0)TS_B = (\mu_1 - \mu_0)(\mu_1 - \mu_0)^T represents the between-class , capturing the variance due to differences in class means, and SW=ΣS_W = \Sigma denotes the within-class , reflecting the common variability within each class. Maximizing J(w)J(w) yields the optimal projection vector w=Σ1(μ1μ0)w = \Sigma^{-1} (\mu_1 - \mu_0), which points in the direction that best discriminates the classes by solving the generalized eigenvalue problem inherent in the criterion. This projection maps the original high-dimensional data onto a one-dimensional line, where the projected distributions of the two classes exhibit maximal separation relative to their spreads. For classifying a new observation xx, the projected value wTxw^T x is compared against a threshold: assign xx to class 1 if (xμ0)Tw>θ(x - \mu_0)^T w > \theta, and to class 0 otherwise, where the threshold θ\theta is typically set to 12wT(μ1μ0)+log(π0/π1)\frac{1}{2} w^T (\mu_1 - \mu_0) + \log(\pi_0 / \pi_1) to account for class priors π0\pi_0 and π1\pi_1, assuming equal misclassification costs. As an illustrative example, consider two-dimensional data consisting of two Gaussian blobs centered at distinct means with identical covariance structures; the optimal LDA projection aligns with the vector connecting the means, transforming the data into a one-dimensional space where the classes are well-separated along this axis for straightforward thresholding.

Mathematical Derivation

Discriminant Functions

In linear discriminant analysis (LDA), the discriminant functions arise from the application of under the assumption of multivariate Gaussian class-conditional densities with equal covariance matrices across classes. Specifically, for a feature vector x\mathbf{x}, the posterior probability of class kk is given by P(Y=kx)πkfk(x)P(Y = k \mid \mathbf{x}) \propto \pi_k f_k(\mathbf{x}), where πk\pi_k is the prior probability of class kk and fk(x)=1(2π)p/2Σ1/2exp(12(xμk)TΣ1(xμk))f_k(\mathbf{x}) = \frac{1}{(2\pi)^{p/2} |\Sigma|^{1/2}} \exp\left( -\frac{1}{2} (\mathbf{x} - \boldsymbol{\mu}_k)^T \Sigma^{-1} (\mathbf{x} - \boldsymbol{\mu}_k) \right) is the class-conditional density with mean μk\boldsymbol{\mu}_k and common Σ\Sigma. Taking the logarithm of the posterior, the classification rule assigns x\mathbf{x} to the class kk that maximizes the discriminant score δk(x)=logπk12(xμk)TΣ1(xμk)\delta_k(\mathbf{x}) = \log \pi_k - \frac{1}{2} (\mathbf{x} - \boldsymbol{\mu}_k)^T \Sigma^{-1} (\mathbf{x} - \boldsymbol{\mu}_k), which includes a quadratic term in x\mathbf{x}. However, since Σ\Sigma is the same for all classes, the term 12xTΣ1x-\frac{1}{2} \mathbf{x}^T \Sigma^{-1} \mathbf{x} is common across all δk(x)\delta_k(\mathbf{x}) and can be ignored for maximization, yielding the linear form δk(x)=xTΣ1μk12μkTΣ1μk+logπk.\delta_k(\mathbf{x}) = \mathbf{x}^T \Sigma^{-1} \boldsymbol{\mu}_k - \frac{1}{2} \boldsymbol{\mu}_k^T \Sigma^{-1} \boldsymbol{\mu}_k + \log \pi_k. This linear function represents the log-posterior up to a constant, enabling efficient computation of class posteriors. When comparing two classes kk and jj, the log-odds ratio simplifies further to δk(x)δj(x)=(μkμj)TΣ1x+c\delta_k(\mathbf{x}) - \delta_j(\mathbf{x}) = (\boldsymbol{\mu}_k - \boldsymbol{\mu}_j)^T \Sigma^{-1} \mathbf{x} + c, where c=12(μkTΣ1μkμjTΣ1μj)+log(πk/πj)c = -\frac{1}{2} (\boldsymbol{\mu}_k^T \Sigma^{-1} \boldsymbol{\mu}_k - \boldsymbol{\mu}_j^T \Sigma^{-1} \boldsymbol{\mu}_j) + \log(\pi_k / \pi_j) is a constant. For equal priors (πk=πj\pi_k = \pi_j), this reduces to a purely linear boundary in x\mathbf{x}. Geometrically, the decision boundary where δk(x)=δj(x)\delta_k(\mathbf{x}) = \delta_j(\mathbf{x}) forms a perpendicular to the vector Σ1(μkμj)\Sigma^{-1} (\boldsymbol{\mu}_k - \boldsymbol{\mu}_j), which points in the direction that maximizes the separation between the projected class means while accounting for the structure.

Eigenvalue and Effect Size Analysis

In linear discriminant analysis, the optimal discriminant directions are determined by solving the generalized eigenvalue problem SBv=λSWvS_B \mathbf{v} = \lambda S_W \mathbf{v}, where SBS_B denotes the between-class , SWS_W the within-class , vi\mathbf{v}_i the eigenvectors representing projection directions, and λi\lambda_i the corresponding eigenvalues that measure the separation achieved along each direction. The eigenvalues λi\lambda_i serve as indicators of discriminatory power, with higher values signifying greater class separation relative to within-class variability; these are typically ordered in descending magnitude to prioritize the most effective directions. The eigenvector associated with the largest eigenvalue corresponds to Fisher's linear discriminant, which maximizes the ratio of between-class to within-class variance. In the binary classification setting, the analysis reduces to a single non-zero eigenvalue, expressed as λ=(μ1μ0)TSW1(μ1μ0)\lambda = (\boldsymbol{\mu}_1 - \boldsymbol{\mu}_0)^T S_W^{-1} (\boldsymbol{\mu}_1 - \boldsymbol{\mu}_0), which equals the squared between the two class means μ1\boldsymbol{\mu}_1 and μ0\boldsymbol{\mu}_0. This eigenvalue quantifies the overall separability of the two classes under the assumptions of equal matrices. Furthermore, in binary LDA, the trace of the eigenvalue matrix, trace(λ)\operatorname{trace}(\lambda), directly corresponds to this squared , providing a scalar summary of the discrimination strength. Effect sizes in LDA are evaluated using multivariate criteria to assess the overall discriminatory capability. Wilks' lambda, defined as Λ=det(SW)det(SB+SW)\Lambda = \frac{\det(S_W)}{\det(S_B + S_W)}, ranges from 0 to 1, with values approaching 0 indicating strong group separation as the between-class variance dominates the total variance. For multivariate extensions beyond the binary case, Pillai's trace offers a complementary measure, computed as the sum of the squared correlations between the discriminant functions and the dependent variables; higher values reflect superior by emphasizing the proportion of variance explained by the between-class component. These metrics enable statistical testing of whether the derived significantly differentiate the classes, with Wilks' often converted to an F-statistic for evaluation.

Extensions to Multiple Classes

Canonical Discriminant Analysis

Canonical discriminant analysis extends linear discriminant analysis to scenarios involving more than two classes, providing a framework for dimensionality reduction through the identification of linear combinations of features, known as canonical variates, that maximize the separation between multiple class means while minimizing within-class variability. In this multivariate generalization, originally formalized for multiple groups by C.R. Rao in 1948, the method derives directions in feature space that capture the essential differences among kk classes, with the number of meaningful canonical variates limited to m=min(p,k1)m = \min(p, k-1), where pp is the dimensionality of the input data. This approach is particularly useful for supervised dimension reduction, projecting high-dimensional data onto a lower-dimensional space where class distinctions are accentuated. The foundational setup involves defining the between-class scatter matrix SBS_B and the within-class scatter matrix SWS_W. For kk classes with prior probabilities πk\pi_k (typically estimated as the proportion of samples in class kk), class-conditional means μk\mu_k, and overall μ=kπkμk\mu = \sum_k \pi_k \mu_k, the between-class is given by SB=k=1Kπk(μkμ)(μkμ)T,S_B = \sum_{k=1}^K \pi_k (\mu_k - \mu)(\mu_k - \mu)^T, which quantifies the dispersion of the class means around the grand . The within-class scatter matrix is SW=k=1KπkΣk,S_W = \sum_{k=1}^K \pi_k \Sigma_k, where Σk\Sigma_k is the of class kk, assuming multivariate normality within each class; in practice, SWS_W is often pooled across classes as the average within-class . These matrices form the basis for the generalized eigenvalue problem SBv=λSWvS_B \mathbf{v} = \lambda S_W \mathbf{v}, solved to obtain the eigenvectors vi\mathbf{v}_i corresponding to the largest eigenvalues λi\lambda_i, which indicate the discriminatory power of each direction. The canonical variates are the projections of the centered onto these eigenvectors: the ii-th canonical variable is yi=viT(xμ)y_i = \mathbf{v}_i^T (x - \mu), with vi\mathbf{v}_i normalized such that viTSWvi=1\mathbf{v}_i^T S_W \mathbf{v}_i = 1. The eigenvalues λi\lambda_i relate to the canonical correlations ρi=λi1+λi\rho_i = \sqrt{\frac{\lambda_i}{1 + \lambda_i}}
Add your contribution
Related Hubs
User Avatar
No comments yet.