SOLUTION1:
Seguindo Duda et al. (Pattern CLassification), que tem uma solução alternativa para @lucas e, nesse caso, facilita muito a computação da solução manualmente. (Espero que esta solução alternativa ajude !! :))
Na LDA de duas classes, o objetivo é:
wTSBwwTSWw
SB=(m1−m2)(m1−m2)TSW=S1+S2S1,S2m1,m2
A solução desse quociente de raleigh generalizado é um probem de valor próprio de generalização.
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: Classificação de Padrões por Duda, Hart, Stork
SOLUTION2:
SBw=λSWw
determinant(SB−λSW)SBw=λSWwλ1,λ2,...,λn, as roots of the polynomial.
Now substitute λ=λi,i∈{1,2,..,n} and get the corresponding eigen vector as solution to the linear system of equations SBwi=λiSWwi. By doing this for each i you can get a set of vectors {wi}ni=1 and it is a set of eigen vectors as solutions.
determinant(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