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


*

*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$.

*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?
 A: Actually most approaches that I know use distances, not correlations.
While computing the distance matrix means you need O(n^2) memory and runtime, and you often could do better, in particular R and Matlab users seem to like this approach a lot. Probably because they have fast routines for doing this particular task, and you would need to do the O(n log n) approaches yourself.
Either way, AFAICT 2) is actually the common approach, and 1) is a work-around to be able to use correlations, by transforming them either via 1-r or 1-r^2 into a dissimilarity matrix.
Logically it obviously does not play a role whether you compute the similarity and then convert it into a dissimilarity in two steps or compute 1-r immediately before storing it in the matrix. However, R and Matlab may have fast routines for computing covariance matrices; that are faster than computing 1-r yourself for every cell (read up on vectorized operations).
Whether 1) or 2) works better probably depends on whether Euclidean distance or Pearson Correlation dissimilarity is more useful for your problem. There are like 50+ other distances you could try.
