The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to implement multiclass LDA (Fisher) ?
Replies: 7   Last Post: Jun 18, 2013 12:10 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Greg Heath

Posts: 214
Registered: 12/13/04
Re: How to implement multiclass LDA (Fisher) ?
Posted: Jun 11, 2012 11:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Jun 9, 12:41 pm, "Chaou " <> wrote:
> Thank you Greg for your response.
> But I do not understand how you campute covarience Sb and Sw without loops.
> You say to compute Sw, I just need to run :
> s1  = (N1-1)*cov(CLASS1);
> etc....
> and then do Sw=s1+s2+s3;
> But how should I do to compute Sb without loops ? I don't know.....

[ I N1 ] = size(CLASS1)
m1 = mean(CLASS1,2)
sw1 = (N-1)*cov(CLASS1)

N0 = N1 + etc
m0 = ( N1*m1 + etc )/N0
sb1 = N1*( m1 - m0 )*( m1 - m0)'

Sw = sw1 + etc
Sb = sb1 + etc

Hope this helps.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.