- Introduced by
- Ronald A. Fisher
- Year
- 1936
- Type
- Supervised classification and dimension reduction
- Family
- Multivariate analysis
What does it do?
Discriminant analysis finds linear combinations of predictor variables that best separate two or more known groups.
It is used both to identify which predictors distinguish the groups and to classify new observations into those groups.
The intuition behind the method
Imagine you have measurements on students — exam scores, hours studied, attendance — and you want to know which combination of these variables most cleanly separates passing from failing students. Discriminant analysis builds a single score (a discriminant function) from the predictors such that the groups are as far apart as possible relative to their spread within each group. This is Fisher's key insight: maximise the ratio of between-group variance to within-group variance.
History
Ronald Fisher introduced the linear discriminant function in 1936, illustrating the method with iris flower measurements to show how a weighted combination of several variables could discriminate between species. The method is one of the earliest supervised multivariate classification techniques. Later treatments interpreted the classification rule in probabilistic terms, relating it to group densities under multivariate normality, and the method is now covered in standard multivariate analysis textbooks.
When to use it
Use discriminant analysis when you have a categorical dependent variable (group membership) and multiple continuous predictor variables, and your goals are either to describe which predictors distinguish the groups or to build a classification rule. It is most appropriate when the predictors are approximately multivariate normal within each group and the within-group covariance matrices are equal (homoscedasticity). Do not use it when predictors are predominantly categorical (prefer logistic regression or log-linear models), when group sizes are very unequal without correction, when the normality and homoscedasticity assumptions are severely violated, or when the number of predictors approaches or exceeds the sample size.
Limitations and considerations
- Assumes multivariate normality of predictors within groups and equal within-group covariance matrices; violations reduce classification accuracy and distort significance tests.
- Sensitive to outliers, which can pull group centroids and inflate within-group scatter.
- Requires that the number of cases per group substantially exceeds the number of predictors; with many predictors relative to sample size, the within-group scatter matrix becomes singular.
- Only finds linear boundaries between groups; non-linear group structures are missed unless quadratic discriminant analysis or kernel methods are used.
- Classification accuracy evaluated on the training sample is optimistically biased without cross-validation or a holdout set.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Simultaneously identifies which predictors drive group separation and produces a classification rule, combining explanation and prediction.
- Produces interpretable discriminant function coefficients and structure coefficients (correlations of each predictor with the function).
- When the groups are multivariate normal with a shared covariance matrix, the linear classification rule coincides with the Bayes rule for the given group priors, so it is a principled choice for those conditions.
- Handles more than two groups by extracting successive discriminant functions, each capturing group separation not explained by the functions before it; the functions are uncorrelated within groups.
- The weights come from a single eigenproblem on the scatter matrices, so no iterative fitting is required.
Applications
- Medical diagnosis, classifying patients into disease or control groups based on clinical biomarkers.
- Marketing research, distinguishing customer segments (buyers vs. non-buyers) from demographic and attitudinal predictors.
- Educational testing, identifying predictors that separate students by achievement level or school type.
- Finance, building credit-scoring or bankruptcy-prediction rules from financial ratios.
- Ecology and taxonomy, separating species or ecological communities based on morphological or environmental measurements.
- Psychology, determining which psychometric scales best differentiate clinical diagnostic groups.
How it works
How it works
The method begins by computing two scatter matrices from the data: the within-group scatter matrix S_W, which measures how much observations vary around their own group mean, and the between-group scatter matrix S_B, which measures how far the group means lie from the grand mean. The criterion J = S_W^{-1} S_B combines these two matrices, and the discriminant weights are chosen to maximise the between-group relative to the within-group scatter that J expresses.
Formula
\mathbf{J} = \mathbf{S}_W^{-1}\mathbf{S}_BEach discriminant function is a weighted linear composite of the p predictor variables. The weights b are chosen so that the resulting score Z maximally separates the groups. For two groups there is one discriminant function. For k groups the number of functions is at most the smaller of k-1 and p, the number of predictors, and each successive function captures group separation not already explained by the functions extracted before it.
Formula
Z = b_1 X_1 + b_2 X_2 + \cdots + b_p X_p
The discriminant weights are the eigenvectors of the matrix S_W^{-1} S_B. Each eigenvector defines one discriminant function. Its eigenvalue λ is the ratio of between-group to within-group variance along that function, so a larger value indicates stronger separation. A canonical correlation can be derived from the eigenvalue to summarise the same separation on a correlation scale.
Formula
\mathbf{S}_W^{-1}\mathbf{S}_B \mathbf{w} = \lambda \mathbf{w}Once functions are extracted, each observation receives a discriminant score and is assigned to the group with the highest posterior probability, computed from the group priors and the distribution of the scores in each group. Under multivariate normality with a shared covariance matrix, this is the Bayes rule that the linear classification rule implements. Classification accuracy is evaluated with a classification table; to avoid overfitting, cross-validation (leave-one-out) or a holdout sample should be used to estimate the true misclassification rate.
Common pitfalls
- Reporting training-sample hit rates as the classification accuracy without cross-validation; always report leave-one-out or holdout accuracy.
- Ignoring the equal-covariance assumption: a significant Box's M test for homogeneity of covariance matrices is a signal to consider quadratic discriminant analysis, which allows unequal covariance matrices. Box's M is sensitive to departures from normality and to large samples, so the covariance matrices should also be inspected and the practical size of the differences judged before switching methods.
- Confusing standardised discriminant coefficients (used to compare predictors) with structure coefficients (correlations of each predictor with the function); both should be reported for full interpretation.
- Using discriminant analysis on predominantly categorical predictors; logistic regression is more appropriate in that case and makes fewer distributional assumptions.
- Retaining trivial discriminant functions: only functions with large canonical correlations and interpretable structure should be named and described.
Frequently asked questions
What is the difference between discriminant analysis and logistic regression?
Both can classify observations into groups using multiple predictors, but they differ in assumptions and approach. Discriminant analysis assumes multivariate normality within groups and equal covariance matrices; when these hold it can be more efficient. Logistic regression makes no distributional assumptions about the predictors and handles categorical predictors more naturally; it is generally preferred when normality or homoscedasticity cannot be justified.
How many discriminant functions are extracted?
The number of discriminant functions is the minimum of (number of groups minus one) and (number of predictors). For two groups there is exactly one function; for k groups there are at most k-1. Each successive function captures residual group separation not explained by earlier ones.
How is classification accuracy evaluated?
The primary summary is the classification table (confusion matrix) showing how many observations were correctly assigned to each group. Hit rates on the training sample are inflated; unbiased estimates come from leave-one-out cross-validation or from classifying a held-out test sample. Chance-corrected accuracy (kappa or Press's Q statistic) adjusts for group size imbalance.
What is the difference between standardised coefficients and structure coefficients?
Standardised discriminant coefficients (weights applied to standardised predictors) indicate each predictor's unique contribution after partialling out others — they are analogous to beta weights in regression. Structure coefficients are simple correlations between each original predictor and the discriminant score; they indicate how closely a predictor relates to the function as a whole, including shared variance. Both are needed for complete interpretation.
When should I use quadratic rather than linear discriminant analysis?
When the within-group covariance matrices differ substantially across groups (a significant Box M test combined with a meaningful practical difference), quadratic discriminant analysis (QDA) should be considered. QDA estimates separate covariance matrices per group and produces curved rather than linear boundaries, often improving classification accuracy in that situation, though it requires larger samples.
Related methods
Sources
Fisher, R. A. (1936). The use of multiple measurements in taxonomic problems. Annals of Eugenics, 7(2), 179–188.
Open DOI referenceHair, J. F., Black, W. C., Babin, B. J. & Anderson, R. E. (2019). Multivariate Data Analysis (8th ed.). Cengage Learning.
ISBN: 978-1473756540Using Multivariate Statistics (6th Edition), section 1.3.1 (One-Way Discriminant Analysis)