How is the "correlation distance" obtained after k-means with correlation is applied?

2 次查看(过去 30 天)
Hi,
I have performed k-means calculation to a set of curves. The traditional k-means calculation minimises euclidean distance but matlab makes possible to minimise the "correlation distance".
Once the centroids are obtained the error (distance) between a curve and its centroid, in the case con euclidean distance this error is equal to the root of the sum of squared difference between all the coordinates (values of the curves):
(sum( (xi - ci)^2 ))^0.5; being xi the values of the curve and ci the values of the centroid.
I have done it manually and it matches with the matlab's result, as expected.
Problem. I have tried to obtain the correlation distance between a curve and its correlation centroid (in order to understand the internal process) without success.
vector = [0.183, 0.212, 0.237, 0.266, 0.286, 0.293, 0.296, 0.285, 0.292, 0.285, 0.278, 0.249, 0.225, 0.184, 0.173, 0.153, 0.182, 0.207, 0.237, 0.232, 0.221, 0.203, 0.177, 0.168, 0.16]
centroid = [ -0.21855, -0.12294, -0.00591, 0.096538, 0.188009, 0.229715, 0.254094, 0.22736, 0.204908, 0.175345539, 0.133732, 0.046236, 0.03547, -0.00712, -0.02923, -0.03936, -0.0303, -0.02336, -0.06685, -0.10802, -0.13891, -0.17165, -0.20264, -0.20557, -0.221 ]
The correlation distance is defined as [ 1 - pearson(vector,centroid) ] but, where matlab gives 0.37917 I obtain 0.1437.
What am I doing bad?
Thank you all in advance,
Jaime
  1 个评论
Jaime Almonacid-Caballer
编辑:Jaime Almonacid-Caballer 2021-6-23
I found it:
The correlation distance is ROOT( 1 - pearson(vector,centroid) )
I leave it here just in case it can be useful for anyone.
My apologies

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by