# Am I right that Calinski-Harabasz index (Pseudo-F) can not be calculated from a distance matrix other than euclidean?

1. Part: I wonder if one could calculate the Calinski-Harabasz index when only having a distance matrix (and a cluster solution, of course). As you need the within and between sum of squares to come up with this so called Pseudo-F index, you also need some sort of (continous) raw data, right?

2. Part: Except that you have a distance matrix that you can be sure contains euclidean distances. You could than come up with the within and between sum of squares based on those euclidean distances, right?

Am I mistaken?

Context: I am working with sequence data at the moment, and there are several ways to prepare them for clustering (I am not bothering you with the details here). One way is to directly come up with some distance metrics based on some global similarities/properties of the sequences - and they are all non-euclidean. If you are interested: here you are.

• Computing them on a distance matrix is O(n²), but usually you would use an O(n) approach to compute them using the total variance and the cluster variances. – Anony-Mousse Aug 24 at 6:28
• Thanks for you comment. My question is more about the theoretical feasibility and whether I'm right that it can only be done with euclidean distances. But I think that is answered. Thank you very much. – MLud Aug 24 at 6:40
• If the slow runtime isn't a problem for you, then you can also use Silhouette, which works with non-Euclidean data. – Anony-Mousse Aug 24 at 6:44