# ANN Sizing Procedure for the Day-Ahead Output Power Forecast of a PV Plant
## 6 Neurons in a Single Layer ANN  
The method illustrated above has been applied to define the number of neurons in a single layer FFNN. First, we examined some networks fed with just one layer between the input and the output. We considered two different types of training, as well as a number of neurons varying between 20 and 160, with a resolution equal to 2 up to 80 neurons, and equal to 4 onwards. Then, for every different topology, 100 training runs were carried out, and as many outputs and relative \(NMAE_{\%}\)s were calculated. Afterwards, we calculated the average and the variance of this parameter, and we chose intervals of 95% confidence for the sample mean. Both methods used the Levenberg-Marquardt (LM) algorithm, together with an early stopping procedure. The \"LM fast\" method adopts the default setting, while the second one has been changed in order to assume a slower convergence towards the solution. This ensures higher protection from overlearning, as suggested in the user's guide [20], together with the default values already set in the Neural Network Toolbox(tm). More in detail, the parameters for the two \"LM\" methods are shown in Table 1, where \(\omega\) is the initial convergence speed, \(\delta\) is the speed increase and \(\Phi\) the speed decrease when the convergence speed is inadequate. The results can be observed in the Figures 1 and 2, where the mean \(NMAE_{\%}\) trend as a function of the neurons in the single hidden layer is shown. The error function reaches a minimum within a broad interval of neurons, after which it seems to increase again. This slight growth is not evident in the slow convergence algorithm (\"LM slow\", Figure 2); however, we may expect that this will not decrease further, as the error has reached a minimum region. In fact, while an exact point for the minimum of the sample mean can be determined, (the red points in Figures 1 and 2), this value is included in an interval of confidence. If such a range matches other minima (which are not necessarily adjacent), it would not be possible to exactly determine which one of the two points actually represents the absolute minimum (the \"optimum\" value). Two intervals of confidence are called \"compatible\" if their intersection is not null. The mean points representing intervals compatible with the minimum interval \begin{table}
\begin{tabular}{c c c} \hline \hline
**Settings** & **LM Fast (Default)** & **LM Slow** \\ \hline \(\omega\) & \(10^{-3}\) & \(1\) \\ \(\delta\) & \(10\) & \(2\) \\ \(\Phi\) & \(10^{-1}\) & \(-0.5\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Levenberg–Marquardt (LM) training algorithm settings. are shown in Figures 1 and 2 (red point), and have been highlighted in yellow. It can be noted that, for the fast convergence algorithm (\"LM fast\", Figure 1) with an equal number of similar networks, the trend is more variable: the higher variance generates wider intervals. As a consequence, we have a higher number of compatible points, and higher uncertainty in the optimum configuration. It is useful to recall here that such intervals contain the real mean value within a 95% degree of confidence. It is then plausible to assume that some of these points are outliers (consider for example the value for 62 neurons in Figure 1). Indeed, the error variation within the optimal range is shown to be minimal in these graphs. Besides, it is better to consider also the error from the ensemble forecasting method as it is described in the following section. Looking at Figures 1 and 2, a suitable number of  
Figure 1: Mean normalized mean absolute error (\(NMAE_{\%}\)) as a function of the number of neurons, with Levenberg–Marquardt training algorithm set for a faster convergence. Comparable mean \(NMAE_{\%}\) in yellow, with 95% interval of confidence, with the minimum in red. Figure 2: Mean \(NMAE_{\%}\) as a function of the number of neurons, with Levenberg–Marquardt training algorithm set for a slower convergence.