The Hartigan-Wong version of the k-means algorithm uses two auxiliary algorithms: the optimal transfer stage (optra) and the quick transfer stage (qtran).
This function is the optra subroutine adapted to the shape analysis context. It is used within HartiganShapes
. See Hartigan and Wong (1979) for details of the original k-means algorithm and Amaral et al. (2010) for details about its adaptation to shape analysis.
optraShapes(array3D,n,c,numClust,ic1,ic2,nc,an1,an2,ncp,d,itran,live,indx)
A list with the following elements: c,ic1,ic2,nc,an1,an2,ncp,d,itran,live,indx, updated after the optimal transfer stage.
Array with the 3D landmarks of the sample objects.
Number of sample objects.
Array of centroids.
Number of clusters.
The cluster to each object belongs.
This vector is used to remember the cluster which each object is most likely to be transferred to at each step.
Number of objects in each cluster.
$an1(l) = nc(l) / (nc(l) - 1), l=1,...,numClust$.
$an2(l) = nc(l) / (nc(l) + 1), l=1,...,numClust$.
In the optimal transfer stage, ncp(l) stores the step at which cluster l is last updated, $l=1,...,numClust$.
In the quick transfer stage, ncp(l) stores the step at which cluster l is last updated plus n, $l=1,...,numClust$.
Vector of distances from each object to every centroid.
itran(l) = 1 if cluster l is updated in the quick-transfer stage (0 otherwise), $l=1,...,numClust$.
Vector that indicates whether a cluster is included in the live set or not.
Number of steps since a transfer took place.
Guillermo Vinue
Vinue, G., Simo, A., and Alemany, S., (2016). The k-means algorithm for 3D shapes with an application to apparel design, Advances in Data Analysis and Classification 10(1), 103--132.
Hartigan, J. A., and Wong, M. A., (1979). A K-Means Clustering Algorithm, Applied Statistics, 100--108.
Amaral, G. J. A., Dore, L. H., Lessa, R. P., and Stosic, B., (2010). k-Means Algorithm in Statistical Shape Analysis, Communications in Statistics - Simulation and Computation 39(5), 1016--1026.
Dryden, I. L., and Mardia, K. V., (1998). Statistical Shape Analysis, Wiley, Chichester.
HartiganShapes