Compute the cophenetic correlation coefficient.
The cophenetic correlation coefficient C of a hierarchical cluster tree Z is the linear correlation coefficient between the cophenetic distances d and the euclidean distances y.
It is a measure of the similarity between the distance of the leaves, as seen in the tree, and the distance of the original data points, which were used to build the tree. When this similarity is greater, that is the coefficient is closer to 1, the tree renders an accurate representation of the distances between the original data points.
Z is a hierarchical cluster tree, as the output of linkage
.
y is a vector of euclidean distances, as the output of pdist
.
The optional output d is a vector of cophenetic distances, in the same lower triangular format as y. The cophenetic distance between two data points is the height of the lowest common node of the tree.
See also: cluster, dendrogram, inconsistent, linkage, pdist, squareform.
The following code
"usage"; X = randn (10,2); y = pdist (X); Z = linkage (y, "average"); cophenet (Z, y)
Produces the following output
ans = 0.8888
Package: statistics