squared pearson distance in kmeans()

Hello
I need to do some clustering using a correlation distance but instead of using the in-built 'distance' 'correlation' wich is defined as d=1-r i need the squared pearson distance d=1-2r. I need this becouse in my aplication anti-correlated data should get the same cluter ID. And know when using the kmeans() function im getting centroids that are highly anticorreleted wich i would like to avoid by combineing them ( by changing the distance to r^2 ) Now, im not that fluent in matlab yet and have some problems reading the kmeans function. Would it be possible to edit it for my pourpose? Would love some tips how to do it.
All best!

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Asked:

on 19 Jan 2014

Community Treasure Hunt

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

Start Hunting!