# Weather Files for the Calibration of Building Energy Models
## 2 Methodology
### Calibration Process with Or-Site and Third-Party Weather Data  
The starting point was an as-built energy model of the building under study, which was the base model on which the calibration process was performed. This first phase of the methodology aimed to analyze the possibility of obtaining optimum quality models using third-party weather files. For this purpose, the BEMs were calibrated with the weather files created with data from the sensors of the on-site weather station and with data from third-party sources during training and checking periods (see Section 2.3). First, to analyze the differences between the two weather files used, a comparison of their data will be made using the Taylor diagram. In this way, it can be seen quickly and precisely which elements of the two kinds of weather are closer to each other and vice versa (Section 3.1), and make a first evaluation of the impact that each meteorological variable will have on the calibration process. It is a widely used diagram for weather comparisons [38; 39; 40; 41; 42; 43], since it shows three statistical metrics in a single figure: the correlation \(R\), the centered root mean square difference (\(RMS_{\mathit{id}ff}\)), and the standard deviation between the reference and test values. The correlation \(R\) ranges from 0 to 1, measuring the degree of similarity between two fields, with 1 being the best value. The centered root-mean-squared difference measures its adjustment in terms of amplitude, (the closer to zero means that the patterns are more similar). Both indices provide qualitative and quantitative information, but for complete characterization, it was necessary to know their variances, measured by the standard deviation. All of this information was used to quantify the pattern similarity between two time series (temperature, humidity, direct normal irradiation, diffuse horizontal irradiation, etc. ); the closer they were to the center (gray point), the better. As an example (Figure 2), the comparison of the time series represented with the red dot (Example 2) had higher similarity than the one represented with the blue dot (Example 1), reaching a correlation  
Figure 1: Diagram of the developed methodology. of 0.99, a standard deviation of 1.175, and a centered root-mean-square difference of 0.24. They were virtually identical and, therefore, produced similar results that had a minor impact on the results of the simulations. \[\sigma_{f}^{2}=\frac{1}{N}\sum_{n=1}^{N}(f_{n}-\bar{f})^{2} \tag{1}\]  
\[\sigma_{r}^{2}=\frac{1}{N}\sum_{n=1}^{N}(r_{n}-\bar{r})^{2} \tag{2}\]  
\[R=\frac{\frac{1}{N}\sum_{n=1}^{N}(f_{n}-\bar{f})(r_{n}-\bar{r})}{\sigma_{f} \sigma_{r}} \tag{3}\]  
\[RMS_{diff}=\Big{[}\frac{1}{N}\sum_{n=1}^{N}[(f_{n}-\bar{f})-(r_{n}-\bar{r})]^ {2}\Big{]}^{1/2} \tag{4}\]  
After the completion of this first process, both energy models were subjected to the calibration process with the on-site and third-party weather files [37]. The calibration process was performed in a training period and evaluated during a checking period, to avoid possible overfitting of the calibration process. In order to achieve an energy model adjusted to the real data, the average temperature measured in each of the thermal zones of the building was used to feed the model. This gave the thermal waveform of the real building. The calibration methodology is based on an optimization process using genetic algorithms, whose objective function looks for the relationship between real and simulated data (Figure 3). Figure 2: Taylor graph example and its formulation [44]. The objective function of the optimization performed is based on the uncertainty indices proposed by Annex 58: the mean absolute error (MAE) and the Spearman range correlation coefficient (\(\rho\)), so that the model obtained could be compared with the models obtained in Annex 58 [45]. * The mean absolute error (MAE, Equation (5)) between measured (\(y_{i}\)) and simulated temperatures (\(\hat{y}_{i}\)) of each of the thermal zones were calculated to evaluate the difference between them.