For two classes, Fisher's criterion is J(w)=(w⊤(m1−m0))2w⊤SWw, where m0,m1 are the class means and SW is the total within-class scatter matrix. Show that the maximiser is w∝SW−1(m1−m0). How do you check it for m1−m0=(3,2) and SW=diag(2,1)?

Supervised learning, Fisher discriminant analysis
Level L3 Intermediate. Length Long. Nature Th+Mat Both.

What's being asked

Whether you can maximise a ratio of quadratic forms and interpret the answer.

Key idea

Set the gradient of J to zero: (w⊤SWw) d=(w⊤d) SWw with d=m1−m0, so SWw∝d and w∝SW−1d.

Steps

  1. The idea: project the data on w so the projected means are far apart (numerator) and each class is tight (denominator, the scatter of projected data). Write d=m1−m0, so J=(w⊤d)2w⊤SWw.
  2. Take the gradient with respect to w using the quotient rule: ∇J=2(w⊤d) d (w⊤SWw)−(w⊤d)2 2SWw(w⊤SWw)2.
  3. Set ∇J=0 and divide by 2(w⊤d)/(w⊤SWw) (nonzero at the optimum): d=w⊤dw⊤SWw SWw.
  4. The factor w⊤dw⊤SWw is just a scalar. So SWw∝d, and w∝SW−1d. The length of w does not matter because J is unchanged if w is scaled.
  5. Numbers: SW−1=diag(12,1), so w∝(1.5,2). Then w⊤d=4.5+4=8.5 and w⊤SWw=2(2.25)+4=8.5, so J=8.528.5=8.5.
  6. Compare with the naive direction w=d=(3,2): w⊤d=13 and w⊤SWw=2(9)+4=22, so J=16922≈7.68<8.5. So the Fisher direction is better.
  7. The maximum value is d⊤SW−1d=92+4=8.5, matching the above.

Common mistakes

How long your answer should be

One page; 7 minutes.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: Class 0 has points (1,2),(2,1),(3,3) and class 1 has points (5,4),(6,6),(7,5). With equal priors, fit LDA (shared covariance). What are the discriminant direction w and the boundary, and which class is the query (4,3) assigned to?
Next in Supervised learning: In Gaussian discriminant analysis with x∣y=k∼N(μk,Σ) (the same Σ for both classes) and P(y=1)=ϕ, show that P(y=1∣x)=σ(w⊤x+b), the logistic function of a linear function of x. Give w and b. For μ0=0, μ1=2, Σ=1, ϕ=0.5 in one dimension, what is P(y=1∣x=1.5)?