Function calculates initial clusters centers for k-means like alghoritms with the following alghoritm (similar to SPSS QuickCluster function)
(a) if the distance between \(x_k\) and its closest cluster center is greater
than the distance between the two closest centers (\(M_m\) and \(M_n\) ), then \(x_k\)
replaces either \(M_m\) or \(M_n\), whichever is closer to \(x_k\).
(b) If \(x_k\) does not replace a cluster initial center in (a), a second test is made:
If that distance \(d_q\) greater than the distance between \(M_q\) and its closest
\(M_i\), then \(x_k\) replaces \(M_q\).
where:
\(M_i\) - initial center of i-th cluster
\(x_k\) - vector of k-th observation
\(d(...,...)\) - Euclidean distance
\(d_{mn}\) = \(min_{ij} d(M_i,M_j)\)
\(d_q = min_i d(x_k,M_i)\)