## 2 Uncertainty Processing Based on Clustering Technique
### Identification of the Number of Typical Combinations of Renewable Power Output and Load Demand  
For the power dataset, each data sample represents a deterministic combination of renewable power output and load demand, while an effective scenario set should contain all the typical combinations. Since data samples belonging to the same cluster have similar values of renewable power output and load demand, each cluster can be considered as a specific data subset representing a typical combination. Thus the optimal cluster number for a power dataset, which corresponds to the number of typical combinations, needs to be identified first. This section employs an iterative graph partitioning method to obtain the optimal cluster number [15]. This method approaches the problem with two kinds of matrix forms: the observation matrix and the judgement matrix. Suppose the dataset \(x\) with \(n\) data samples has been already clustered into \(h\) clusters, then an \(n\times n\) observation matrix \(M^{O}\) is given by:  
\[M^{O}_{ij}=\left\{ \begin{array}{ll}1&x_{i},x_{j}\in Cluster\,\eta\\ 0&x_{i},x_{j}\
otin Cluster\,\eta\end{array} \right.\quad(\eta\in[1,h]) \tag{1}\]  
The observation matrix \(M^{O}\) represents the clustering relationships among all the data samples under a defined cluster number. Obviously, a single observation matrix can hardly reveal the accurate clustering distribution of a complex dataset, especially when the optimal cluster number is unknown. Thus it is essential to compute the observation matrices with different cluster numbers to obtain more clustering information. Suppose there is an observation matrix set with the total number \(c\) of clusters ranging from 2 to \(k\), the judgement matrix \(M^{J}\) is defined as follows to extract the key information:  
\[M^{J}=\sum_{c=2}^{k}M^{O}_{c} \tag{2}\]  
where \(M^{O}_{c}\) is the observation matrix with the cluster number set to \(c\). It can be observed that the judgement matrix \(M^{J}\) integrates the clustering relationships among data samples under different cluster numbers. The value of each matrix element indicates the similarity degree between the corresponding data samples; for example, a large value of \(M^{J}_{ij}\) means a high similarity degree between \(x_{i}\) and \(x_{j}\), and in that case there will be a high probability that \(x_{i}\) and \(x_{j}\) are grouped into the same cluster. On the basis of the above two kinds of matrix forms, the steps of the identification method are given in brief below [15]:  
1. Employ the partitioning clustering algorithm to cluster the power dataset iteratively with the cluster number ranging from 2 to \(k\), then obtain the observation matrix set according to Equation (1). 2. Compute the judgement matrix \(M^{l}\) as the sum of the obtained observation matrix set. 3. On the basis of Breadth-First Search (BFS) algorithm, record the number of independent connected sub-matrices in \(M^{l}\). The recorded number represents the total number of clusters in the current iteration. 4. Update the judgement matrix \(M^{l}\) by decreasing the value of each non-zero element as follows: \[M^{l}_{ij}=\left\{ \begin{array}{cc}M^{l}_{ij}-1&if\,M^{l}_{ij}\geqslant 1\\ 0&otherwise\end{array} \right.\] (3)
5. If all elements of the updated judgement matrix \(M^{l}\) become zero, then go to the next step. Otherwise, go to step (c). 6. Analyze the recorded number of sub-matrices in all iterations. The number with the maximum stability degree is viewed as the optimal cluster number. In step (f), the stability degree of a given sub-matrix number \(c\) refers to the consecutive occurrence number of \(c\) in all iterations. The number with the maximum stability degree means that under this number, the connections of the data samples within the sub-matrices (clusters) are the strongest and hardest to break [15]. It should be noted that the partitioning clustering algorithm is employed as a fast clustering technique to accelerate the iterative clustering process in step (a).