# Prediction of Building's Thermal Performance Using LSTM and MLP Neural Networks
## 3 Results and Discussion
### Thermal Demand Analysis  
The results of the thermal demand predictions for the two samples studied, through which the thermal inertia of the building was analyzed in this section, are shown in Figure 4. Specifically, the results of the LSTM models are shown in Figure 4a and the results of the MLP models are shown in Figure 4b. Each time-lag structure analyzed is represented in the figures through the prediction with the lowest error among the 10 repetitions of the analysis. LSTM models were capable of replicating the trend of the thermal demand of the building (except for certain peaks). They also yielded a small variation between the different replications of the analysis. This is shown in Table 2, with average errors of less than 20% and standard deviationsbelow 0.05, in the two samples considered in this study. In sample 1 (first row of Figure 4a) the lag structure that produced the best results is the one with 6 lags (CV(RMSE) = 15.26%). In addition, it is also the structure with the smallest variation in the 10 experiment repetitions. As shown in Table 2 and Figure 4a, in this sample the average errors are, in general, higher than those of sample 2. Although in Figure 4a all the models are close to the real values, as only the best predictions of each model are shown, in Table 2 the differences between their average performances are presented. Thus, the model that considers 12 lags is the architecture that obtained the highest average error (CV(RMSE) = 19.13%) and presents the largest variability in its results. In sample 2 (second row of Figure 4a), where the models were better adjusted to reality, the architecture that obtained the best average performance, as shown in Table 2, is the 1-lag architecture (CV(RMSE) = 14.35%). In this case, smaller errors are not accompanied by more stable results; the highest stability was achieved with the model with 24 lags. On the contrary, the model that obtained the highest error and the largest variability is the one that considers 12 lags (CV(RMSE) = 17.34%). MLP models, as shown in Figure 4b, were also capable of predicting the actual thermal demand of the building with errors of less than 18%. As with LSTM models, certain peaks in the validation sample were not perfectly predicted and their variability among analysis repetitions was also small (below 0.02). However, these models yield better results than LSTM models (see Table 2). In sample 1 (first row of Figure 4b) the model with the lowest average error, as with LSTM models, is the model that considered 6 time lags (CV(RMSE) = 14.90%). In addition, this architecture is the one that produced the most stable results (see Table 2). On the contrary, the lag structure that adjusts reality in the worst way and produced the highest average error is the 12-lag structure (CV(RMSE) = 19.38%). It is also the structure that yields the most variable errors. In this case, a higher average error means more variability in predictions. In sample 2 (second row of Figure 4b), as in LSTM models, the predictions, on average, were better than in sample 1 (see Table 2). The architecture of lags that produced the lowest  
Figure 4: Results of thermal demand predictions in sample 1 (upper side) and sample 2 (bottom side) considering the different structures of time lags. Each architecture is represented by the prediction curve with the lowest error among the 10 repetitions: (**a**) LSTM models; (**b**) MLP models. average error is the architecture of 1 lag (CV(RMSE) = 14.17%); the same structure as with the LSTM models. In this situation it is not the most stable model. On the other hand, the model that yielded the worst performance is the model that considered 24 lags (CV(RMSE) = 17.43%); not being the most variable model. In the case of sample 2, as presented in Table 2, the models with the least errors and the most stable models do not coincide. In the case of the thermal demand of the building studied, its thermal inertia is significant but up to a certain limit of time lags.