QTS K-Means Alignment AlgorithmSource:
This function massages the input quaternion time series to feed them into the k-means alignment algorithm for jointly clustering and aligning the input QTS.
kmeans(x, k, iter_max = 10, nstart = 1, ...) # S3 method for default kmeans( x, k, iter_max = 10, nstart = 1, algorithm = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"), trace = FALSE, ... ) # S3 method for qts_sample kmeans( x, k = 1, iter_max = 10, nstart = 1, centroid = "mean", dissimilarity = "l2", warping = "affine", ... )
Either a numeric matrix of data, or an object that can be coerced to such a matrix (such as a numeric vector or a data frame with all numeric columns) or an object of class qts_sample.
An integer value specifying the number of clusters to be look for.
An integer value specifying the maximum number of iterations for terminating the k-mean algorithm. Defaults to
An integer value specifying the number of random restarts of the algorithm. The higher
nstart, the more robust the result. Defaults to
character: may be abbreviated. Note that
"Forgy"are alternative names for one algorithm.
logical or integer number, currently only used in the default method (
"Hartigan-Wong"): if positive (or true), tracing information on the progress of the algorithm is produced. Higher values may produce more tracing information.
A string specifying which type of centroid should be used when applying kmeans on a QTS sample. Choices are
medoid. Defaults to
A string specifying which type of dissimilarity should be used when applying kmeans on a QTS sample. Choices are
pearson. Defaults to
A string specifying which class of warping functions should be used when applying kmeans on a QTS sample. Choices are
affine. Defaults to
An object of class
stats::kmeans if the input
x is NOT of class
qts_sample. Otherwise, an object of class
kma_qts which is
effectively a list with three components:
qts_aligned: An object of class qts_sample storing the sample of aligned QTS;
qts_centers: A list of objects of class qts representing the centers of the clusters;
best_kma_result: An object of class fdacluster::kma storing the results of the best k-mean alignment result among all initialization that were tried.