## 3 Materials and Methods
### Methodology
Many authors use the most known method for selecting k--the silhouette method. Once \(k\) is selected, the discussion of cluster stability strengthens the choice, with the connectivity criteria being put in second place or neglected, given that it implicitly intervenes, to a certain extent, in grouping the series into clusters. A criterion for selecting between two clusterings is the maximum separability between clusters, represented as the ratio BSS/TSS (the sum of squared distances inside the clusters over the sum of squared distances between the clusters). The higher the ratio, the better the clustering is. Connectivity is a local measure of how well the points within a cluster are related to each other, but it does not capture stability across multiple clustering runs. It helps evaluate intra-cluster compactness rather than the overall consistency of the clustering process. Stability indicators are broader measures designed to quantify how stable the clustering results are when the algorithm is applied multiple times. For example, using bootstrapping, stability indicators assess the variation in cluster assignments when the data are perturbed (through resampling, for instance). In the case of k-means clustering, stability indicators are particularly helpful when the data are noisy or when the choice of the number of clusters is uncertain. Therefore, stability is the criterion that should be given priority after detecting the optimal number of clusters when various methods provide different values of \(k\). This study assessed the internal clustering connectivity using the Silhouette width, Dunn index, and connectivity. The first coefficient takes values between \(-1\) and \(1\) and should be maximized. The other two are positive and should be minimized--Dunn or maximized--connectivity. The clusters' stability was evaluated by the mean distance between means (ADM), average distance (AD), average proportion of non-overlap (APN), the figure of merit (FOM) [41; 42], and average Jaggard measure (AJ). The lower the ADM, APM, and FOM, the better the stability. AJ values above 0.85 indicate high stability of a particular cluster, between 0.6 and 0.85 its stability, and less than 0.6 its instability [43]. Given the various computational methodologies, discordances in the clustering validations--stability versus connectivity--are likely to appear. No selection criterion is perfect. Thus, the scientist must balance the criterion for choosing k with the cluster's stability and connectivity. Therefore, in this study, we tried to strike a balance between all the criteria when choosing clustering. The k-means was chosen because it has the following advantages against the hierarchical clustering [44]:  
* It is relatively simple and easy to implement;
* Has a lower computational complexity, which allows it to handle datasets more efficiently;
* Has a higher computational efficiency and scalability accuracy;
* Mean or median can be used as a cluster center, offering flexibility;
* It is less sensitive to outliers. Compared to Gaussian mixture models [45], the k-means algorithm is less computationally intensive [46]. Moreover, GMMs can overfit the data, capturing noise rather than the underlying distribution. Since the Anderson-Darling test rejected the series normality in most cases and we found that various data series come from some kinds of simple distributions (as shown in Results), the Gaussian mixture was not preferred for clustering. Determine the principal components (PCs) that significantly influence clustering based on the statistical features. The Principal Component Analysis (PCA) is used to reduce a dataset's dimensionality \"while retaining as much as possible of the variation present in the dataset. This is achieved by transforming to a new set of variables, the principal components (PCs), which are uncorrelated and ordered so that the first few retain most of the variation present in all of the original variables\" [47].