2.1.2. Agglomerative Clustering

Agglomerative clustering (AC) is one of the main forms of hierarchical clustering. These algorithms do not provide a single partitioning of the data but instead provide a full hierarchy of cluster solutions from all observations in a single cluster (i.e., *k* = 1) to all observations in individual clusters (i.e., *k* = *n*) [48]. In contrast to KC, hierarchical methods allow existing clusters to be split or merged, with the result that smaller clusters are related to large clusters in a hierarchy. The rules governing which clusters are again based on their distance or similarity. The AC algorithm consists of the following steps:


A key decision in the AC algorithm is the calculation of dissimilarity between clusters. In this study, we used Euclidean distance [47], and the Ward linkage, which measures the distance between the cluster centroids, similar to the K-means clustering method. The equations for Euclidean distance and Ward linkage are defined by Equations (2) and (3), respectively:

$$\|a - b\|\_2 = \sqrt{\sum\_{I} (a\_i - b\_i)^2} \tag{2}$$

where *a* and *b* mean the Euclidean vector; *ai* and *bi* are the point position for the Euclidean vector; *i* is the number of vectors.

$$d\_{\bar{i}\bar{j}} = d\left( \{ \mathbf{X}\_{\bar{i}} \}, \{ \mathbf{X}\_{\bar{j}} \} \right) = \left\| \mathbf{X}\_{\bar{i}} - \mathbf{X}\_{\bar{j}} \right\|^2 \tag{3}$$

where *dij* is the squared Euclidean distance between point *i* and point *j*; *Xi* and *Xj* are Ward's vectors.

The resulting hierarchy of clusters can be represented using a dendrogram plot [48]. The detailed introduction of the dendrogram plot can be found in Section 2.3.5 below.

#### 2.1.3. Spectral Clustering

Spectral clustering (SC) is an unsupervised learning technique based on graph theory, where SC takes advantage of graph information from the spectrum to find the number of clusters [49]. Unlike the previous methods that tend to prioritize clusters by proximity, SC aims to identify observations that are linked, and therefore may not form classical spherical groups in parameter space. The SC algorithm is as follows:


As SC performs dimensionality reduction before clustering data points, it is a very flexible approach for complex data sets. However, the similarity matrix generated by SC may include negative values, which can be problematic for grouping time-series points.
