| hclust {squat} | R Documentation |
QTS Hierarchical Agglomerative Clustering
Description
This function massages the input quaternion time series to apply hierarchical agglomerative clustering on them, with the possibility of separating amplitude and phase variability and of choosing the source of variability through which clusters should be searched.
Usage
hclust(x, metric, linkage_criterion, ...)
## Default S3 method:
hclust(
x,
metric = c("euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"),
linkage_criterion = c("complete", "average", "single", "ward.D2"),
...
)
## S3 method for class 'qts_sample'
hclust(
x,
metric = c("l2", "pearson"),
linkage_criterion = c("complete", "average", "single", "ward.D2"),
n_clusters = 1L,
warping_class = c("affine", "dilation", "none", "shift", "srsf"),
centroid_type = "mean",
cluster_on_phase = FALSE,
...
)
Arguments
x |
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. |
metric |
A character string specifying the distance measure to be used.
This must be one of |
linkage_criterion |
A string specifying which linkage criterion should
be used to compute distances between sets of curves. Choices are
|
... |
Further graphical arguments. E.g., |
n_clusters |
An integer value specifying the number of clusters.
Defaults to |
warping_class |
A string specifying the warping class Choices are
|
centroid_type |
A string specifying the type of centroid to compute.
Choices are |
cluster_on_phase |
A boolean specifying whether clustering should be
based on phase variation or amplitude variation. Defaults to |
Value
An object of class stats::kmeans or stats::hclust or
dbscan_fast if the input x is NOT of class qts_sample. Otherwise,
an object of class qtsclust which is effectively a list with four
components:
-
qts_aligned: An object of classqts_samplestoring the sample of aligned QTS; -
qts_centers: A list of objects of classqtsrepresenting the centers of the clusters; -
best_clustering: An object of classfdacluster::capsstoring the results of the best k-mean alignment result among all initialization that were tried. -
call_name: A string storing the name of the function that was used to produce the clustering structure; -
call_args: A list containing the exact arguments that were passed to the functioncall_namethat produced this output.
Examples
out <- hclust(vespa64$igp[1:10], n_clusters = 2)
plot(out)