Euclidean distance scaled by the variance
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
Let a and b are two n-dimensional vectors.
Also, let s2_i is the variance of the of the i-th element of all vectors and s2_mean is the average value of the variance for i=1,2,...,n
How the following version of Euclidean distance is implemented?
d(a,b)=sqrt(sum (s2_i/s2_mean)*(a_i-b_i)^2)
where a_i and b_i are the i-th elements of vectors a and b respectively.
The function
y=pdist2(a,b,'seuclidean') corresponds to the euclidean distance divided by the corresponding element of the standard deviation.
The one I am refer to is a slight variation to the 'seuclidean'.
Thank you very much.
Best,
Natasha
0 Kommentare
Akzeptierte Antwort
Jan
am 1 Sep. 2012
Bearbeitet: Jan
am 2 Sep. 2012
What exactly is "the variance of the of the i-th element of all vectors"? You have two [1 x n] vectors a and b, but what does "all" mean then?
"d(a,b)=sqrt(sum (s2_i/s2_mean)*(a_i-b_i)^2)" seems to be almost the full solution:
d = sqrt(sum(s2 ./ s2_mean) .* (a - b) .^ 2)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!