span>
so that the log multivariate normal can be implemented directly up to a proportion
by
<span class="math display">\[
\mathrm{normal}\left( y_n | \mu_k, \mathrm{diag\_matrix}({\bf 1}) \right)
\propto \exp \left (- \frac{1}{2} \sum_{d=1}^D \left( \mu_{k,d} - y_{n,d}
  \right)^2 \right).
\]</span>
The spatial perspective on <span class="math inline">\(K\)</span>-means arises by noting that the inner
term is just half the negative Euclidean distance from the cluster
mean <span class="math inline">\(\mu_k\)