Statistics Toolbox | ![]() ![]() |
Cophenetic correlation coefficient
Syntax
Description
computes the cophenetic correlation coefficient which compares the distance information in c = cophenet(Z,Y)
Z
, generated by linkage
, and the distance information in Y
, generated by pdist
. Z
is a matrix of size (m-1)-by-3, with distance information in the third column. Y
is a vector of size .
For example, given a group of objects {1, 2, ..., m} with distances Y
, the function linkage
produces a hierarchical cluster tree. The cophenet
function measures the distortion of this classification, indicating how readily the data fits into the structure suggested by the classification.
The output value, c
, is the cophenetic correlation coefficient. The magnitude of this value should be very close to 1 for a high-quality solution. This measure can be used to compare alternative cluster solutions obtained using different algorithms.
The cophenetic correlation between Z(:,3)
and Y
is defined as
Y.
Z(:,3).
Y
and Z(:,3)
, respectively.
Example
rand('seed',12); X = [rand(10,3);rand(10,3)+1;rand(10,3)+2]; Y = pdist(X); Z = linkage(Y,'centroid'); c = cophenet(Z,Y) c = 0.6985
See Also
cluster
, dendrogram
, inconsistent
, linkage
, pdist
, squareform
![]() | combnk | cordexch | ![]() |