LDA as a generative classifier with Gaussian class-conditional densities and a shared covariance matrix, the linear discriminant functions and decision boundaries, the one-dimensional case and the effect of priors, quadratic discriminant analysis when covariances differ, Fisher's LDA as supervised dimensionality reduction (between- vs within-class scatter), and comparisons with logistic regression and PCA.
LDA is a generative model: it models how each class generates its features, then classifies with Bayes' theorem.
Prior: P(y=k)=πk (estimated by class proportions).
Class-conditional density: x∣y=k∼N(μk,Σ) — Gaussian with a class-specific mean and a shared covariance.
Classify by the largest posterior, i.e. the largest discriminant function (log of πkp(x∣k) with common terms dropped):
δk(x)=x⊤Σ−1μk−21μk⊤Σ−1μk+lnπk.
δk is linear in x, so the boundary {δk=δj} between any two classes is a hyperplane.
Estimation: π^k=nk/n, μ^k = class sample mean, Σ^ = pooled within-class covariance n−K1∑k∑i∈k(xi−μ^k)(xi−μ^k)⊤.
The one-dimensional case
With means μ1,μ2, common variance σ2 and priors π1,π2, the boundary is
x∗=2μ1+μ2+μ2−μ1σ2lnπ2π1.
Equal priors give the midpoint; a larger prior for class 1 pushes the boundary towards class 2.
Same-shape Gaussians: the posterior is equal where the (prior-weighted) densities cross.
Quadratic discriminant analysis (QDA)
If each class has its own covariance Σk, the quadratic terms no longer cancel:
δk(x)=−21ln∣Σk∣−21(x−μk)⊤Σk−1(x−μk)+lnπk,
giving quadratic boundaries. QDA is more flexible (lower bias) but estimates K2d(d+1) covariance parameters (higher variance). Gaussian naive Bayes is QDA with diagonal covariances.
Model
Covariance
Boundary
Parameters (covariance)
LDA
shared Σ
linear
2d(d+1)
QDA
Σk per class
quadratic
K2d(d+1)
Gaussian NB
diagonal Σk
quadratic (axis-aligned)
Kd
Fisher's LDA: supervised dimensionality reduction
Find a projection z=w⊤x that separates the class means while keeping each class compact. For two classes, maximise Fisher's criterion
J(w)=w⊤SWw(w⊤(m1−m2))2=w⊤SWww⊤SBw,
with within-class scatter SW=∑k∑i∈k(xi−mk)(xi−mk)⊤ and between-class scatter SB=(m1−m2)(m1−m2)⊤. The solution is
w∝SW−1(m1−m2).
For K classes, the directions are the top eigenvectors of SW−1SB, at most K−1 of them. Under LDA's Gaussian assumptions, classifying in this projected space is equivalent to the LDA classifier.
PCA finds the direction of largest spread; LDA finds the direction that separates labelled classes.
LDA vs related methods
LDA
Logistic regression
PCA
Uses labels
yes
yes
no
Models
p(x∣y), P(y) (generative)
P(y∣x) (discriminative)
covariance of x
Output
class + projection
class probabilities
projection
Assumptions
Gaussian classes, shared covariance
linear log-odds
none (linear structure)
Quick revision
Practice questions
GATE-style questions: 2 one-mark and 6 two-mark. Wrong MCQs cost ⅓ of their marks in the real exam; MSQ and NAT have no negative marking. Attempt each before opening the solution.
Q1NAT2 marks
A one-dimensional LDA model has class means μ1=0 and μ2=4, common variance σ2=1 and equal priors. The decision boundary is at x= ______.
Q2NAT2 marks
Same model (μ1=0, μ2=4, σ2=1) but with priors π1=0.8 and π2=0.2. The decision boundary is at x= ______ (round to two decimals).
Q3MCQ1 mark
LDA produces linear decision boundaries because it assumes
Q4NAT2 marks
Two classes have within-class scatter matrix SW=(2001) and mean difference m1−m2=(4,2)⊤. Fisher's discriminant direction is w∝SW−1(m1−m2). The ratio w1/w2 is ______.
Q5NAT1 mark
For a classification problem with 4 classes and 10 features, the maximum number of useful Fisher discriminant directions (LDA components) is ______.
Q6MSQ2 marks
Which statements are correct?
One or more options are correct.
Q7MCQ2 marks
Compared with logistic regression, LDA
Q8NAT2 marks
LDA with d=10 features estimates one shared covariance matrix. The number of distinct parameters in that symmetric covariance matrix is ______.