# ANN Sizing Procedure for the Day-Ahead Output Power Forecast of a PV Plant
## 7 Number of Trials in the Ensemble Forecast  
In order to obtain the lowest error, it is also worthwhile to estimate how many trials should be employed in the ensemble forecast. The improvement is expected to reach an asymptotic value with a growing number of trials; however, by increasing the amount of trials, the calculation time is enlarged. Therefore, there is a threshold gain between the number of trials and the reached improvement.  
The procedure of looking for the minimum _NMAE\({}_{\%}\)_, along with the amount of trials, is outlined as follows. The training Levenberg-Marquardt algorithms both with fast and slow convergence are adopted, and the ensemble forecast is performed by an ANN with 120 number of neurons. A growing number of trials were analyzed up to a maximum equal to one thousand.  
First, the _NMAE\({}_{\%}\)_ is calculated for ten independent ensemble forecasts. The term \"independent\" means that different ensemble forecasts do not have common trials. The \(n\)-th ensemble forecast is performed by using a growing quantity of trials, starting from one trial and going up to one hundred trials, in order to infer the global trends of the ensemble _NMAE\({}_{\%}\)_, while trying to avoid any possible random influence due to a few number of cases.  
Figures 3 and 4 show the results of this analysis for the LM fast and slow training algorithms, respectively. They represent the ten _NMAE\({}_{\%}\)_ error curves as a function of the average outputs number used for the ensemble method (grey lines). The mean _NMAE\({}_{\%}\)_ of the ten ensemble forecasts is depicted in red; the mean _NMAE\({}_{\%}\)_ of one thousand forecasts is the upper constant dashed green line; and the _NMAE\({}_{\%}\)_ of the ensemble forecast made by one thousand trials is the lower constant dash-dotted blue line. The red line represents a \"trend index\", and it rapidly tends to an asymptotic value that can be considered \"stable\".  
Figure 3: _NMAE\({}_{\%}\)_ of ten random ensemble (grey lines) as a function of the growing number of trials. The artificial neural network (ANN) has 120 neurons and an “LM fast” training algorithm. The mean of the ten ensemble forecasts \(\overline{NMAE}_{p}\) is in red, the mean _NMAE\({}_{\%}\)_ of one thousand forecasts is the dashed green line, and the ensemble _NMAE\({}_{\%}\)_ of one thousand forecasts is the dash-dotted blue line.  
It must be pointed out that as far as the number of trials gets close to one thousand, the red and the blue line will tend to coincide. However, the graphs have an upper limit equal to 100 trials in the \(x\) axis, as we consider ten independent ensembles from one thousand different forecasts.  
When the slow convergence algorithm is used, such stability is reached for a smaller number of trials, as shown in Figure 4. Furthermore, the curves' variability here is lower, reflecting the lower error variance of the output. Even the advantage initially offered by the fast convergence algorithm--that is, the short calculation time--seems now to be compensated for by the need of a lower number of outputs in the slow convergence algorithm. A larger number of forecasts in the ensemble method would slightly decrease _NMAE_%, which bears the brunt of a much higher computational burden.