Unlike logistic regression directly modeling using the logistic function, linear discriminant analysis model the distribution of the predictors X separately in each of the response classes (i.e. ), and then use Bayes’ theorem to flip these around into estimates for .
The advantage of linear discriminant model over logistic regression:
- When the classes are well-separated, the parameter estimates for logistic regression model are surprisingly unstable.
- When the distribution of the predictor X is approximately normal, the linear discriminant analysis model is very similar in form to logistic regression. However, when the n is small, the LDA is more stable than logistic regression.
- LDA is more popular for multiclass classification problem.
Saying we have a K classes classification problem (K >= 2), let values. Let πk represent the overall or porior probability that a randomly chosen observation comes from the kth class and let Let denote the density function of X for an observation that comes from the kth class. According to Bayes’ theorem, we have
Thus the LDA provide us a way to indirectly computer by plugging in estimates of and . Once we get the (posterior probability), we can develop a classifier that approximates the Bayes classifier by classifying an observation to the class for which this probability is largest.
Now the question has been changed to how we estimate and . In general, estimating is easy if we have a random sample of Y s from the population: we simply compute the fraction of the training observations that belong to the kth class. However, for , we need to assume some simple forms for these densities. Suppose we assume that is Gaussian or normal distributed. In one-dimensional setting (i.e. we have only one predictor), the normal density function is
And let’s further assume there is a shared variance term across all K classes, that is, . Then we plug the normal density function into the Bayes’ formula and get
Taking the log of the equation above and rearranging the terms, it’s easy to find out that this is equivalent to assigning the observation to the class for which
is largest. Recall Bayes classifier assigns an observation according to the biggest probability and has the lowest error rate. But in a real-life situation, since we don’t know the parameters and , we are actually not able to calculate the Bayes classifier. So what linear discriminant analysis (LDA) tries to do is to approximate the Bayes classifier by estimating parameters and calculate the corresponding probabilities. In particular, the following estimates are used:
The estimate for is simply the average of all the training observation from the kth class, while can be seen as a weighted average of the sample variance for each of the K classes. As for , LDA estimates it using the proportion of the training observation that belong to the kth class ().
Finally, LDA just assigns an observation X = x to the class for which
is largest. The term linear comes from the fact the discriminant functions are linear functions of x.
When extending to multiple predictors, the situation is very similar. Now we need assume that is drawn from a multi-variate Gaussian (or multivariate normal) distribution, with a class-specific mean vector and a common covariance matrix.
All in all, the LDA classifier results from assuming that the observations within each class come from a normal distribution with a class-specific mean vector and a common variance , and plugging estimates for these parameters into the Bayes classifier.
An Introduction to Statistical Learning by Trevor Hastie, Robert Tibshirani