## 2 Materials and Methods
### Artificial Neural Network Model
#### 2.3.2 ANN (\(t\)-7) Model  
The ANN (\(t\)-7) model is very similar to the ANN (\(t\)-1), except for the input vector. In this case, the 7 input residuals, \(e_{t}^{*}\), are not close to the one to be predicted but are shifted seven days backward. In this way, by moving the input vector from \(t\)-13 to \(t\)-7, this model can give an output of seven predictions, from \(t\) to \(t\)+6. The structure of the network is reported in Table 9.  
Again, two cycles were run, to minimize the objective function. In Figure 6, the results of the two training cycles are reported: the lowest value for the objective function is 0.46 for the first cycle and 0.43 for the second one. These results were achieved after 22 epochs in the first cycle and after 24 epochs in the second cycle. In Figure 7, the regression lines are shown: the correlation coefficient is 0.73 at the end of the first cycle and 0.74 after the second one. Thus, thanks to the weekly periodicity of the dataset, the network still has good predictive performances, even if the input vector includes data that are \"one week old\" compared to the considered day.  
Figure 5: Regression lines after the training process of the ANN (\(t\)-1) model: the blue line is the fit on 60% of the training data, the green line is the fit on 20% of the validation data, and the red line is the fit on 20% of the test data. The dashed line is the bisector of the plot, where simulated data are equal to the real ones. The last plot is the regression fit on all 1087 data; the figure on the left (**a**) is related to the first tuning, and the figure on the right (**b**) is related to the second tuning.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Inputs** & **One Hidden Layer** & **Output** \\ \hline \(e_{t-7}^{*}\) & & \\ \(e_{t-8}^{*}\) & & \\ \(e_{t-9}^{*}\) & & \\ \(e_{t-10}^{*}\) & 140 Neurons & \(\hat{a}_{t}\) \\ \(e_{t-11}^{*}\) & & \\ \(e_{t-12}^{*}\) & & \\ \(e_{t-13}^{*}\) & & \\ \hline \hline \end{tabular}
\end{table}
Table 9: Topological structure of ANN (\(t\)-7) second neural network.  
The set of weights obtained with the second training cycle has been used in the network to be combined with the DD-TSA model for prediction. Figure 8 shows the predicting results of the trained network, in the set of 1087 data used in the calibration phase: in this case, the good forecasting performances are confirmed by a correlation coefficient of 0.72.  
Figure 6: Performance achieved during the calibration process of the ANN (_t-7_) model. For the first tuning, the figure on the left (**a**), the mean square error after 22 epochs is 0.46. For the second tuning, the figure on the right (**b**), the mean square error after 2 epochs is 0.43. Circles indicate the values at the selected epoch.  
Figure 7: Regression lines after the training process of the ANN (_t-7_) model: the blue line is the fit on 60% of the training data, the green line is the fit on 20% of the validation data, and the red line is the fit on 20% of the test data. The dashed line is the bisector of the plot, where simulated data are equal to the real ones. The last plot is the regression fit on all 1087 data; the figure on the left (**a**) is relative to the first tuning, and the figure on the right (**b**) is relative to the second tuning.  
The prediction of the final hybrid model is given by the following:  
\[F_{t}=\hat{D}_{t}+\hat{e}_{t}, \tag{4}\]  
in which \(\hat{D}_{t}\) is the DD-TSA output (deterministic part prediction) and \(\hat{e}_{t}\) is the ANN output (random component estimation). The error of this model (or residual if calculated in the calibration phase) is given by the following:  
\[\Delta_{t}=A_{t}-(\hat{D}_{t}+\hat{e}_{t}). \tag{5}\]  
This error will be used to check the performance of the different models and to highlight their peculiarities.