## 3 Forecasting Approach
### The Proposed Hybrid Methodology
#### 3.1.3 Step III: SVR  
At this stage, a SVR model is applied to each cluster. The three different adjustable parameters, which governs the SVR model, were determined by an iterative process (trial-and-error). The parameters of the different SVR models tested are shown in Table 1. Note that the optimum number of clusters was two. This issue is further explained below. For each cluster, the inputs of the SVR model are formed by the clustered data of the original time series, \(y_{i}\), and their forecasted values, \(p_{i}\), and residuals, \(e_{i}\), obtained in the second (SARIMA) step (\(i\) denotes the cluster they belong to). The presence or absence of these variables in the inputs determine the hybrid configurations. Each variable is sorted recursively as an autoregressive window. The sizes of the original data, predicted values and residuals from the SARIMA step are denoted as \(ny\), \(np\) and \(ne\), respectively. Due to the reduction of available data in the clusters, a randomized resampling strategy was implemented during the SVR process to ensure the independence of the results. For this work, a twofold cross-validation (2-CV) technique was used. This validation strategy was repeated 20 times and the final value of the prediction performances was the average of these repetitions. The 20 repetitions were implemented for each combination of parameter values of the range shown in Table 1. Once all the range values of the parameters were tested, the parameter combination that achieves the best performance \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameters** & **Cluster** & \multicolumn{2}{c}{**Values**} \\ \hline Hybrid configuration: & & SOM-SARIMA-SVR-1 & SOM-SARIMA- SVR-2 \\ Number of variables: & & & \\ Input layer & 1 & \(e_{1}\) & \(y_{1}\), \(p_{1}\), \(e_{1}\) \\  & 2 & \(e_{2}\) & \(y_{2}\), \(p_{2}\), \(e_{2}\) \\ Output layer & 1 & \(e_{1}\) & \(y_{1}\) \\  & 2 & \(e_{2}\) & \(y_{2}\) \\ Autoregressive window size (step: 1): & & & \\ Residual (\(e\)): \(ne\) & 1, 2 & 1:20 & none, 1:20 \\ Original data (\(y\)): \(ny\) & 1, 2 & - & none, 1:10 \\ Predicted values (\(p\)): \(np\) & 1, 2 & - & none,1:20 \\ Parameters: & & & \\ \(\epsilon\) (step: 1): & 1, 2 & \(2^{(-12-2)}\) & \(2^{(-12-2)}\) \\ \(\gamma\) (step: 1): & 1, 2 & \(2^{(-12-2)}\) & \(2^{(-12-2)}\) \\ C: & 1, 2 & 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 50, 100:1000 (step: 100) \\ Prediction horizons & 1, 2 & 1, 7 days \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameter ranges used for the SVR models in the third step. The subscript indicates the cluster to which the parameter belongs to (1 or 2). index values is selected. The total predicted time series is formed by adding the predictions of each clusters. Note that, as in the SARIMA model, the best SVR model may be different on each cluster. Two hybrid approaches were proposed and assessed. The prediction results were obtained for two prediction horizons, \(ph=1\) and \(ph=7\). _SOM-SARIMA-SVR-1 model (hybrid approach 1)._ This classical approach considers that the relationship between the linear component \(L_{t}\) and the nonlinear component \(NL_{t}\) of a time series is additive. Therefore, the time series can be decomposed in these two independent terms. Then, a linear forecasting model such as SARIMA can be applied in order to model the linear component and thereby to obtain the predicted values, \(\hat{p}_{t}\), and the residual, \(e_{t}\). Subsequently, a SVR model is applied over the residuals in order to fit the nonlinear component \(NL_{t}\). The main assumption of this traditional approach is that the nonlinear relationship of the time series can be found, if any, in the residuals of the linear model.