# Evaluation and Comparison of Spatial Clustering for Solar Irradiance Time Series
## 4 Koppen Climatic Classification and Clustering Methods
### Geographical Clustering Methods
#### 4.2.1 The Available Tools  
Applied to our geographical clustering problem, the methodology concerns a given set of data, D (SIAR data), from which we previously extracted indices about its static and dynamic behaviors. The problem of the whole clustering of time-series data is formally well defined in Reference [19] as follows: time-series clustering, given a dataset of n time-series data, \(D=\{F_{1},\ F_{2},\ldots,F_{n}\}\), the process of unsupervised partitioning of \(D\) into,  
Figure 10: Köppen classification, updated from SIAR data for the years 2017–2020. \(C=\{C_{1},\ C_{2},\ldots,C_{n}\}\), in such a way that homogenous time series are grouped together based on a certain similarity measure, is called time-series clustering. Then \(C_{i}\) is called a cluster, where \(D=\cup_{i=1}^{k}C_{i}\) and \(C_{i}\cap\ C_{j}=0\) for \(i\
eq j\). A schematic of the main clustering techniques is shown in Figure 11.  
The hierarchical clustering algorithm is a method in which data are grouped based on the distance between each one and looking for the data within a cluster to be the most similar to each other. It can also be seen as a graphical representation where elements are nested in tree-like hierarchies [73]. Hierarchical clustering strategies can be either agglomerative (each observation starts in its own cluster) or divisive (all observations start as a single cluster). We decided to apply only the first one during simulations. Indeed, the purpose is to group the meteorological stations with the smallest distance between their dynamic and static characteristics. The partitive clustering is different and allows to divide a dataset into k clusters by trying to minimize some specified error functions. In k-means and k-medoids cases, each data point belongs to a single group. Data points are assigned to a cluster such that the sum of the squared distance between the data points and the centroid of the cluster (means for k-means or median for k-medoid) is minimal [74; 75]. Spectral clustering is a technique that reduces complex multidimensional datasets into clusters of similar data in rarer dimensions [76]. It is based on calculating the eigenvalues of the data-similarity matrix in order to reduce the dimensionality of the system. Many details about clustering and the pitfalls to avoid are given in the valuable [PERSON] papers [17]. In summary, k-means and k-medoids methods are the most commonly used clustering algorithm [77; 78], with the number of clusters, k, specified by the user. Hierarchical clustering generates a nested hierarchy of similar groups of time series according to a pairwise distance matrix of the series [79]. Both of these clustering approaches, however, require that the length of each time series be identical due to the Euclidean distance calculation requirement and are unable to deal effectively with long-time series due to poor scalability. From a mathematical point of view now, k-means is defined from a set of observations (x\({}_{1}\), x\({}_{2}\),..., x\({}_{n}\)). Each observation is a d-dimensional real vector; k-means clustering aims to partition the n observations into k (\(\leq\)n) sets S = {S\({}_{1}\), S\({}_{2}\),..., S\({}_{k}\)} so as to minimize the within-cluster variance. Formally, the objective is to find the following (\(\mu_{i}\) is the mean of points in S\({}_{i}\)):  
\[\underset{S}{\text{argmin}}\sum_{i=1}^{k}\sum_{x\in S_{i}}\|x-\mu_{i}\|2 \tag{5}\]  
The hierarchical clustering is operated from sophisticated algorithms. In this technique, initially each data point is considered as an individual cluster. At each iteration, the similar clusters merge with other clusters until one cluster or k-clusters are formed. The basic algorithm is straightforward (agglomerative case):  
* Compute the proximity matrix;
* Let each data point be a cluster;  
Figure 11: Main clustering techniques. A visible highlight in Table 2 concerns the fact that some clustering methods need to know the number of clusters to determine.