SOLUTION1:
Nach Duda et al. (Musterklassifizierung), die eine alternative Lösung zu @lucas bietet und in diesem Fall eine sehr einfach zu berechnende Lösung von Hand darstellt. (Hoffe, diese alternative Lösung hilft !! :))
In zwei Klassen LDA ist das Ziel:
wTSBwwTSWw
SB=(m1−m2)(m1−m2)TSW=S1+S2S1,S2m1,m2
Die Lösung dieses verallgemeinerten Raleigh-Quotienten ist ein verallgemeinertes Eigenwertproblem.
SBw=λSWw→SW−1SBw=λw
SBm1−m2w∝SW−1(m1−m2)
w
SW−1(m1−m2)=(S1+S2)−1(m1−m2)=([2001]+[1001])−1([00]−[44])=([1/3001/2])([00]−[44])=[−1.3333−2.0000]∝[0.55470.8321]
Ref: Pattern Classification von Duda, Hart, Stork
SOLUTION2:
SBw=λSWw
determinant(SB−λSW)SBw=λSWwλ1,λ2,...,λn,λ=λi,i∈{1,2,..,n}SBwi=λiSWwi{wi}ni=1
de t e r m i n a n t ( SB- λ SW)=[16−3λ161616−2λ]=6λ2−80λ, So eigen values are roots to polynomial 6λ2−80λ.
So λ= 0 and 40/3 are the two solutions.
For LDA, eigen vector corresponding to highest eigen value is the solution.
Solution to system of equation (SB−λiSW)wi=0 and λi=40/3
which turns out to be [16−3λ161616−2λ]wi∝[−724848−32]wi=0
Solution to the above system of equation is [−0.5547−0.8321]∝[0.55470.8321] which is same as previous solution.
Alternatively, we can say that [0.55470.8321] lies in the null space of [−724848−32].
For two class LDA, eigen vector with highest eigen value is the solution. In general, for C class LDA, the first C - 1 eigen vectors to highest C - 1 eigen values constitute the solution.
This video explains how to compute eigen vectors for simple eigen value problem. ( https://www.khanacademy.org/math/linear-algebra/alternate_bases/eigen_everything/v/linear-algebra-finding-eigenvectors-and-eigenspaces-example )
Following is an example.
http://www.sosmath.com/matrix/eigen2/eigen2.html
Multi-class LDA:
http://en.wikipedia.org/wiki/Linear_discriminant_analysis#Multiclass_LDA
Calculating Null Space of a matrix:
https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/null_column_space/v/null-space-2-calculating-the-null-space-of-a-matrix