linkage
statistics: y = linkage (d)
statistics: y = linkage (d, method)
statistics: y = linkage (x)
statistics: y = linkage (x, method)
statistics: y = linkage (x, method, metric)
statistics: y = linkage (x, method, arglist)
Produce a hierarchical clustering dendrogram.
d is the dissimilarity matrix relative to n observations,
formatted as a x1 vector as produced by pdist.
Alternatively, x contains data formatted for input to
pdist, metric is a metric for pdist and
arglist is a cell array containing arguments that are passed to
pdist.
linkage starts by putting each observation into a singleton
cluster and numbering those from 1 to n. Then it merges two
clusters, chosen according to method, to create a new cluster
numbered n+1, and so on until all observations are grouped into
a single cluster numbered 2(n-1). Row k of the
(m-1)x3 output matrix relates to cluster n+k: the first
two columns are the numbers of the two component clusters and column
3 contains their distance.
method defines the way the distance between two clusters is computed and how they are recomputed when two clusters are merged:
Reference Ward, J. H. Hierarchical Grouping to Optimize an Objective Function J. Am. Statist. Assoc. 1963, 58, 236-244, http://iv.slis.indiana.edu/sw/data/ward.pdf.
See also: pdist, squareform
Source Code: linkage