Euclidean distance scaled by the variance

6 views (last 30 days)
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

Accepted Answer

Jan
Jan on 1 Sep 2012
Edited: Jan on 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)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!