# Clustering and correlations

I have a dataset of $n$ $p$-dimensional vectors (objects) that I want to cluster.

1. One way to do this is to compute the ($n \times n$) correlation matrix $C$, then obtain a dissimilarity matrix, $D$, from $C$ such that each element $d_{ij}$ in $D$ is a function of the single element $c_{ij}$ in $C$ (e.g., $D=1-C$), and then cluster on $D$.

2. Instead, I want to take $C$ and obtain $D$, such that each element $d_{ij}$ of $D$ is a function of the entire vectors $C_i$ and $C_j$ in $C$ (for example, $d_{ij}$ can be the Euclidean distance between $C_i$ and $C_j$).

Why do 2)?:

• Approach 1) computes the dissimilarity (distance) between two input vectors $i$ and $j$ solely as a function of the similarity between $i$ and $j$; in contrast, approach 2) computes the dissimilarity (distance) between two input vectors $i$ and $j$ as a function of the similarity of the similarities between $i$ and all other vectors vs. $j$ and all other vectors.
• On the problems with which I am working, approach 2) seems to perform better in practice.

What I am wondering is whether there is any reason why approach 2) would not be valid?

• Plus to @Anony-Mousse's answer, please read this and this answers which show how and why Pearson r can be geometrically correctly converted into euclidean distance. You can cluster based or r, of course, but clustering on euclidean d is more flexible: more clustering techniques applicable and more sane interpretations possible. Feb 16, 2013 at 22:28
• Can you clarify Instead, I want...obtain D , such that each element d_ij is a function of the entire vectors C_i and C_j? Do you mean you want the $d_{ij}$ to incorporate all n-1 correlations of object i and likewise of object j? If yes, how do you see it? Example? There must be some multivariate analysis done before - to fulfil your idea. Feb 16, 2013 at 22:50
• Thank you all for your comments. To clarify, here is a basic example. Let us have 4 objects with a correlation matrix C={C_1, C_2, C_3, C4}, where C_1={1,0.3,0.2,-0.5}, C_2={0.3,1,-0.2,0.9}, C_3={0.2,-0.2,1,0.5}, C_4={-0.5,0.9,0.5,1}. With approach 1, d_12=(1-c_12)=1-0.3=0.7. With approach 2, d_12=||C_1-C_2||=1.76 (approx.). So approach 2 still uses correlations, but it computes Euclidean distances (or some other metric) on pairs of correlation vectors. Feb 16, 2013 at 23:40
• @ttnphns, just to point out, this is for agglomerative clustering. Feb 17, 2013 at 1:46
• So you take corr. matrix as data matrix, and compute eucl. d between its columns (or rows, which is the same); that means that you aim to cluster objects based on similarity of their correlational profiles rather than on magnitude of pairwise correlations. Well, you are in right to do it, but this is totally different analysis and so words seems to perform better in practice become meaningless. Also, your d_12=||C_1-C_2||=1.76 partly mixes diagonal with off-diagonal elements: 1-0.3 and 0.3-1, which is questionnable. To my mind, only off-diagonal elements should be compared. Feb 17, 2013 at 7:54