Hi, I was peeking inside the test_multiclass_lda function to look at how dval and prob are calculated. I noticed that this line:
dval = arrayfun( @(c) sum( bsxfun(@minus, coordinates, cf.centroid(c,:)).^2, 2), 1:cf.nclasses, 'Un',0);
should already give the squared Euclidean distance. But then later in the Gaussian function, where the squared distance is expected, dval is squared again:
prob = 1/sqrt(2*pi) * exp(-(dval.^2)/2);
So, is this really a bug, or did I get it wrong? I'm not too familiar with the math behind it, so maybe I miss something and I hope this is not a silly question, but I thought it's better to ask here anyway.
Best regards
Alexandros Karagiorgis
PhD student
Magdeburg
Hi, I was peeking inside the test_multiclass_lda function to look at how dval and prob are calculated. I noticed that this line:
dval = arrayfun( @(c) sum( bsxfun(@minus, coordinates, cf.centroid(c,:)).^2, 2), 1:cf.nclasses, 'Un',0);
should already give the squared Euclidean distance. But then later in the Gaussian function, where the squared distance is expected, dval is squared again:
prob = 1/sqrt(2*pi) * exp(-(dval.^2)/2);
So, is this really a bug, or did I get it wrong? I'm not too familiar with the math behind it, so maybe I miss something and I hope this is not a silly question, but I thought it's better to ask here anyway.
Best regards
Alexandros Karagiorgis
PhD student
Magdeburg