## 7 Model Validation  
After the parameter tuning via genetic algorithm described in the previous section, the resulting model accuracy needed to be measured. For this analysis, the ABM was composed by by 2000 agents; each simulation required around 10 s with a 2.40 GHz Intel QuadCore (i7-5500U CPU) with a 16 GB of RAM. The genetic algorithm used a population of 50 individuals and the overall time required to calibrate the model was around 30 h. As mentioned before the parameters tuning was made using observed data in the period 2007-2013; observed data in the 2014-2017 range was used only during testing. To summarize, the experimental setup was the following: (1) create an ABM and calibrate its parameters with the genetic algorithm; (2) simulate the 2007-2017 period with the fine-tuned ABM; (3) observe the simulated PV cumulative installed power and adoption rate--the difference between observed and simulated data in 2007-2013 measures the quality of the fine-tuning technique, while the difference measured in the 2014-2017 period serves to evaluate the predictive capability of the model. This scheme was repeated 30 times to obtain statistically significant values; in the rest of the paper, only mean values were reported (in both graphs and table). As metrics for the evaluation, we considered the mean absolute error (MAE), the root mean squared error (RMSE), the mean absolute percentage error (MAPE), and the coefficient of determination (\(R^{2}\)). These are standard metrics and are defined by the following equations (the equation for \(R^{2}\) is not reported for the sake of clarity):  
\[MAE =\frac{1}{N}\sum_{i=1}^{N}|o_{i}-s_{i}| \tag{6}\] \[RMSE =\sqrt{\frac{1}{N}\sum_{i=1}^{N}(o_{i}-s_{i})^{2}}\] (7) \[MAPE =\frac{100}{N}\sum_{i=1}^{N}\frac{|o_{i}-s_{i}|}{o_{i}}, \tag{8}\]  
where \(N\) is the number of runs (30), \(s_{i}\) is the simulated value, for instance the PV power installed in one year in the simulated environment of the ABM, and \(o_{i}\) is the observed value. We considered two outcomes to measure the fine-tuning and prediction results: (1) the yearly installed PV power and (2) the cumulative installed power, that is the total value obtained by summing previous years installed power and the current year's installed capacity. The former value better reflects the yearly changes in adoption rate while the latter could be more useful to policy makers to devise strategies for reaching long-term goals (i.e., a certain amount of total PV power by year 2020). Table 1 reports the validation results after the parameter tuning. Each row corresponds to a year; the table includes both the period used as training set (2007-2013) and the period used to evaluate the predictive capability (2014-2017), separated by a horizontal line. The last row reports the average values computed over the whole time frame 2007-2017. The first column corresponds to the year;the following three columns report MAE, RMSE and MAPE for the yearly installed PV power; the last three columns show the same metrics computed on the cumulative installed power. Let us consider first the yearly adoption rate. Following the type of validation made by most other works in the literature, that was looking only at the results on the training set, it can be noted that the fit was extremely good. The average \(R^{2}\) on the training set was equal to 0.997, the MAE was equal to 0.385, the RMSE was equal to 0.483, and the MAPE was equal to 4.52. These values indicate that the parameter tuning was very effective. A higher MAPE can be observed for the year 2008 (15.41); the simulated installed PV power was lower than the observed one and this could indicate that the current version of the ABM did not include some drivers that boosted the adoption of PV panels in early years. Moving on and considering also the predictive capability of the proposed approach, the results remain promising.