## 4 Case Study
### B-Spline Regression Mixtures for Time-Series Clustering  
An alternative algorithm for time-series clustering is regression mixtures, which overcomes the limitations of the \(K\)-means and SC algorithms by utilizing an inference technique based on iteratively maximizing posterior probability. Table 3 displays the BIC values obtained by fitting the B-spline regression mixtures using time-series clustering for various values of \(K\) (ranging from one to eight) and different B-spline orders (from two to five). Our implementation employed spline knots that were uniformly distributed across the time-series domain. \begin{table}
\begin{tabular}{c c c} \hline  & _CH_ & _DB_ \\ \hline \(K=1\) & \(NaN\) & \(NaN\) \\ \(K=2\) & 0.8369 & 7.5416 \\ \(K=3\) & 1.5623 & 3.3407 \\ \(K=4\) & 0.5670 & 4.4918 \\ \(K=5\) & 0.3818 & 4.9000 \\ \(K=6\) & 0.9225 & 3.7632 \\ \(K=7\) & 1.3381 & 4.4297 \\ \(K=8\) & 1.4708 & 5.0791 \\ \hline \end{tabular}
\end{table} 
Table 2: Values of the \(CH\) and \(DB\) indices for different values of \(K\) for the SC algorithm in the reference case study. The maximum value of \(CH\) and minimum value of \(DB\) are obtained for \(K=3\). Figure 4: Graphical representation of the centroids for the two clusters generated through the implementation of the \(K\)-means algorithm with \(K=2\). Varying colors differentiate profiles. The maximum BIC value, which was equal to \(-7.7054\), was obtained when a B-spline of order three and a value of \(K=6\) (number of clusters) were used, as indicated in Table 3. The log-likelihood in Equation (3) can be maximized using the APECM algorithm. Following the implementation of the APECM algorithm, a soft partition of the time-series data into \(K=6\) clusters is obtained using the estimated posterior probabilities of component membership \(\pi_{ik}^{(q)}\) in Equation (4). A hard partition can be obtained by allocating each time series to the component (cluster) with the highest posterior probability value. A graphical representation of the resulting centroids for the B-spline model of order three for each of the six clusters is shown in Figure 6.  
Figure 6 shows that B-spline regression mixtures provide valuable information for data mining. Specifically, three clusters with different shapes were identified to represent the low-load energy profiles (peaks of less than or equal to 10 kWh). Clusters 1, 4, and 5 encompassed the low-load profiles. Conversely, Clusters 2, 3, and 6 represent high-load energy profiles (peaks greater than 10 kWh and up to 15 kWh). Cluster 2 describes a high-load profile at an interval of approximately 16 h, while Clusters 3 and 6 describe high-load profiles with a shorter duration of approximately 7 h. Furthermore, Cluster 3 grouped energy profiles with high loads during the first half of the day, whereas Cluster 6  
Figure 5: Graphical representation of the centroids for the two clusters generated through the implementation of the SC algorithm with \(K=3\). Varying colors differentiate profiles. \begin{table}
\begin{tabular}{c c c c c} \hline  & **Order 2** & **Order 3** & **Order 4** & **Order 5** \\ \hline \(K=1\) & \(-9.8558\) & \(-9.8551\) & \(-9.8576\) & \(-9.8578\) \\ \(K=2\) & \(-7.8063\) & \(-7.8004\) & \(-7.8044\) & \(-7.8031\) \\ \(K=3\) & \(-7.7764\) & \(-7.7357\) & \(-7.7765\) & \(-7.7370\) \\ \(K=4\) & \(-7.7549\) & \(-7.7309\) & \(-7.7510\) & \(-7.7350\) \\ \(K=5\) & \(-7.7321\) & \(-7.7232\) & \(-7.7285\) & \(-7.7209\) \\ \(K=6\) & \(-7.7236\) & \(-7.7054\) & \(-7.7343\) & \(-7.7227\) \\ \(K=7\) & \(-7.7392\) & \(-7.7095\) & \(-7.7281\) & \(-7.7201\) \\ \(K=8\) & \(-7.7317\) & \(-7.7204\) & \(-7.7663\) & \(-7.7293\) \\ \hline \end{tabular}
\end{table} 
Table 3: BIC values for B-spline regression mixtures for different values of \(K\) and orders. The maximum BIC value is obtained for \(K=6\) and B-spline of order 3 (BIC equal to \(-7.7054\)). grouped energy profiles with high loads during the second half of the day. This information is of utmost importance for energy planning and consumption.