Euclidean distance scaled by the variance
조회 수: 10 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!