</span> to the data point <span class="math inline">\(y_n\)</span>.</p>
</div>
<div id="stan-implementation-of-soft-k-means" class="section level3">
<h3 class="unnumbered" number="">Stan Implementation of Soft <span class="math inline">\(K\)</span>-Means</h3>
<p>Consider the following Stan program for implementing <span class="math inline">\(K\)</span>-means
clustering.</p>
<pre><code>data {
  int&lt;lower=0&gt; N;  // number of data points
  int&lt;lower=1&gt; D;  // number of dimensions
  int&lt;lower=1&g