Unlimited learning, half price | 50% off
Get 50% off unlimited learning

mlmts (version 1.1.2)

mc2pca_clustering: Performs the crisp clustering algorithm of Li (2019)

Description

mc2pca_clustering performs the clustering algorithm proposed by li2019multivariate;textualmlmts, which is based on common principal component analysis (CPCA).

Usage

mc2pca_clustering(X, k, var_rate = 0.9, max_it = 1000, tol = 1e-05)

Value

A list with two elements:

  • cluster. A vector defining the clustering solution.

  • iterations. The number of iterations before the algorithm stopped.

Arguments

X

A list of MTS (numerical matrices).

k

The number of clusters.

var_rate

Rate of retained variability concerning the reconstructed MTS samples (default is 0.90).

max_it

The maximum number of iterations (default is 1000).

tol

The tolerance (default is 1e-5).

Author

Ángel López-Oriona, José A. Vilar

Details

This function executes the crisp clustering method proposed by . The algorithm is a \(K\)-means-type procedure where the distance between a given MTS and a centroid is given by the reconstruction error taking place when the series is reconstructed from the common space obtained by considering all the series in the cluster associated with the corresponding centroid (the common space is the centroid).

References

li2019multivariatemlmts

Examples

Run this code
clustering_algorithm <- mc2pca_clustering(BasicMotions$data, k = 4, var_rate = 0.30)
# Executing the clustering algorithm in the dataset BasicMotions (var_rate = 0.30,
# i.e., we keep only a few principal components for computing the reconstructed series)
clustering_algorithm$cluster # The clustering solution
clustering_algorithm$iterations # The number of iterations before the algorithm
library(ClusterR)
external_validation(clustering_algorithm$cluster, BasicMotions$classes,
summary_stats = TRUE) # Evaluating the clustering algorithms vs the true partition
# stopped

Run the code above in your browser using DataLab