title: What is the intuition behind centroid linkage in hierarchical clustering?
body: <p>In the sample code below I would expect a tree with 3 branches if it was really using centroids. Indeed the 2 closest points are A and B with a distance of 1 &lt; sqrt(5)/2. The centroid of cluster (A,B) is (0.5,0) which is also at a distance 1 from C. But this is not what I am observing.</p>
  
  <p>I know that the Lance-Williams formula is used to compute the distances (<a href="https://stats.stackexchange.com/questions/217519/centroid-linkage-clustering-with-hclust-yields-wrong-dendrogram">https://stats.stackexchange.com/questions/217519/centroid-linkage-clustering-with-hclust-yields-wrong-dendrogram</a>). So the distance between (A,B) and C is 0.5*(sqrt(5)/2) + 0.5*(sqrt(5)/2) - 1/4 = 0.868. But what does it mean and what is the link with centroids ?</p>
  
  <p>Sample code :
  `</p>
  
  <pre><code>A &lt;- c(0,0)
  B &lt;- c(1,0)
  C &lt;- c(0.5, 1)
  df &lt;- t(data.frame(A=A, B=B, C=C))
  plot(df)
  hc &lt;- hclust(d = dist(df), method = "centroid")
  library(ggdendro)
  p &lt;- ggdendrogram(hc, rotate = FALSE, size = 2)
  p
  </code></pre>
  
  <p>`</p>