Euclidean distance scaled by the variance

조회 수: 10 (최근 30일)
Natasha Kratowska
Natasha Kratowska 2012년 8월 31일
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

채택된 답변

Jan
Jan 2012년 9월 1일
편집: Jan 2012년 9월 2일
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개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by