Prediction of Building’s Thermal Performance Using LSTM and MLP Neural Networks

: Accurate prediction of building indoor temperatures and thermal demand is of great help to control and optimize the energy performance of a building. However, building thermal inertia and lag lead to complex nonlinear systems is di ﬃ cult to model. In this context, the application of artiﬁcial neural networks (ANNs) in buildings has grown considerably in recent years. The aim of this work is to study the thermal inertia of a building by developing an innovative methodology using multi-layered perceptron (MLP) and long short-term memory (LSTM) neural networks. This approach was applied to a public library building located in the north of Spain. A comparison between the prediction errors according to the number of time lags introduced in the models has been carried out. Moreover, the accuracy of the models was measured using the CV(RMSE) as advised by AHSRAE. The main novelty of this work lies in the analysis of the building inertia, through machine learning algorithms, observing the information provided by the input of time lags in the models. The results of the study prove that the best models are those that consider the thermal lag. Errors below 15% for thermal demand and below 2% for indoor temperatures were achieved with the proposed methodology.


Introduction
The residential sector makes an important contribution to energy consumption worldwide, representing more than the 40% of the total energy use in the European Union (EU) [1]. The EU has established several guidelines and directives to improve energy performance in buildings, such as 2010/31/EU (EPBD) [2] and 2012/27/EU [3], requiring that new buildings comply with nearly zero-energy buildings (NZEB) by 2030 [4] and to reach a decarbonized and highly energy efficient building stock by 2050. Therefore, energy efficiency in buildings is of great importance to the overall sustainability. Knowing exactly and precisely the energy consumption of a building is the first step to be able to optimize its energy performance. However, forecasting the building energy consumption is a difficult issue that many authors have investigated in recent years [5][6][7].
Different methods have been developed to predict building energy demand. Traditionally, dynamic simulation has been used successfully [8][9][10] becoming a suitable tool, that enables the assessment of building performance and the calculation of energy use. There are several building energy performance simulation (BEPS) tools available, such as TRNSYS [11], EnergyPlus [12] or DOE-2 [13]. However, the use of dynamic simulation tools requires the knowledge and control of many different parameters of The MLP neural network training is done with a backward propagation algorithm; errors are propagated through the network and adapted to the hidden layers. Thus, error-correction learning (actual system responses must be known) is used to train the ANN [29,50]. There are several ways to perform the training [19,51] but, the methodology used in this work consists of updating the weights with an average update of the weights (batch learning), which is achieved by incorporating all the patterns in the input file (an epoch) and accumulating all the weight updates. There is also a need for a stop criterion [52,53]. Although there are other options, such as a threshold for the mean square error (MSE) or a limitation on the maximum number of iterations, the most widely used is crossvalidation. This method is most effective in stopping training when the best generalization is achieved. It consists of separating a small part of the training data and using it to evaluate the trained network. Thus, training should stop the moment the network performance, quantified by the mean square error (MSE), begins to decrease or stagnates [18][19][20]31].
Lastly, in all MLP models created in this paper the activation function selected was the reLU function (rectified linear unit: (0, )) [54], the kernel initializer was normal and the optimizing algorithm was the adaptive moment estimation (Adam) [55]. On the other hand, the batch size used to train the MLP neural networks was equal to 64 (mini-batch gradient descent [56]) and the patience (limit to stop the training if the performance of the model does not improve) was 100 epochs. The MLP neural network training is done with a backward propagation algorithm; errors are propagated through the network and adapted to the hidden layers. Thus, error-correction learning (actual system responses must be known) is used to train the ANN [29,50]. There are several ways to perform the training [19,51] but, the methodology used in this work consists of updating the weights with an average update of the weights (batch learning), which is achieved by incorporating all the patterns in the input file (an epoch) and accumulating all the weight updates. There is also a need for a stop criterion [52,53]. Although there are other options, such as a threshold for the mean square error (MSE) or a limitation on the maximum number of iterations, the most widely used is cross-validation. This method is most effective in stopping training when the best generalization is achieved. It consists of separating a small part of the training data and using it to evaluate the trained network. Thus, training should stop the moment the network performance, quantified by the mean square error (MSE), begins to decrease or stagnates [18][19][20]31].
Lastly, in all MLP models created in this paper the activation function selected was the reLU function (rectified linear unit: max(0, x)) [54], the kernel initializer was normal and the optimizing algorithm was the adaptive moment estimation (Adam) [55]. On the other hand, the batch size used to train the MLP neural networks was equal to 64 (mini-batch gradient descent [56]) and the patience (limit to stop the training if the performance of the model does not improve) was 100 epochs.

Long Short-Term Memory Neural Networks
LSTM is a recurrent neural network architecture specifically for modeling time sequences and their long-range dependencies more accurately than conventional RNNs. LSTM introduces specific units (memory blocks) into the recurrent hidden layer that store the temporal state of the network through self-connections. In addition, the memory block also contains units known as gates to control the flow of information [38,40]. A forget gate was incorporated into the memory blocks to prevent the LSTM model from processing continuous input flows without being segmented in subsequences. Furthermore, more complex LSTM networks also incorporate peephole connections between internal cells and their gates to learn the timing of the outputs [32,35].
The structure of traditional RNNs [57] can be presented by deterministic transitions from previous to current hidden states in form of a function: where h l t represents a hidden state in layer l in timestep t. However, LSTM counts with a complex dynamic that allows memorizing information for many timesteps. Long-term information is stored in a vector of memory cells m l t ∈ R n [21,37]. The LSTM networks are empowered to decide whether to overwrite, retrieve or maintain this information for the next timestep. Their architecture is the following: . , x k be a classic input sequence (with k lags), where x t ∈ R D denotes the vector of D real values at the timestep t. The LSTM architecture defines an input gate i t , a forget gate f t and an output gate o t . At specific time t, as is observable in Figure 2a where an LSTM cell is shown, the hidden layer output would be h t , the cell input state ∼ N t and the cell output state N t [21,38,39,41]. The two values N t (Equation (1)) and h t (Equation (2)) that are transmitted to the next timestep, following the steps explained in [21,39], can be calculated as follows: A particular LSTM neural network was built for the prediction of indoor temperatures and thermal demand of the studied building (see Figure 2b). In this case, the input matrix of the network would be the observed data X t (see Table 1) and the one-dimensional output the predicted future data ∼ Y t+1 (Equation (3)). Once known h t (Equation (2)) the network output will be: where W 2 is the weight matrix connecting the last hidden layer to the output layer and b the bias term in the output layer (see Figure 2b). Specifically, the LSTM architecture used in this study is also variable due to the different complexity of the models based on the number of time lags introduced. The variable parameters were the number of hidden and LSTM layers and the number of hidden neurons. In this case, the layer structures (LSTM and hidden layers) in the tested grid were: 2-1, 2-2, 3-1 and 3-2. On the other hand, the number of hidden neurons was a grid with eight values between 5 and 500. In addition, as in the MLP models, the activation function of the models was the reLU function [54], the kernel initializer was normal, the optimizing algorithm was Adam [55] and the batch size equal to 64 [56]. In order to avoid overfitting problems, they were trained with the same early stop as MLP neural networks (100 epochs) [52,53].

Pre-Processing Data
The data available in this study are hourly observations of two variables related to climate (outdoor temperature and solar radiation) and two related to the energy performance of the building (indoor temperature and thermal demand) between February and March of 2017 (see Table 1).
A continuous sample without large sets of missing values was necessary due to the use of hourly time lags as inputs in the models. This means that to train a model, besides the information of the independent variables at a given moment, the information of past instants of certain variables is also introduced. This study focuses on the prediction of thermal demand and indoor temperature of the studied building. The variables that have been used as explanatory variables of the models are presented in Figure 3. Although only the variables related to thermal conditions have been lagged, to add more information to the models, three time variables have been added (see Table 1). These three variables (hour of day, day of week and hour of year) do not provide any additional information being delayed due to their artificial nature.
to add more information to the models, three time variables have been added (see Figure 4). These three variables (hour of day, day of week and hour of year) do not provide any additional information being delayed due to their artificial nature. Generally, as the number of time lags considered increases, the complexity of the model needs to change (there is more information to be extracted). Therefore, a process based on repetition (cross validation design; data are divided into training, test and validation [58]) was carried out to find the best parameters for each model and for each of the different lagged architectures studied. This process consists of repeating a prediction of the same test sample 10 times with each model (the second week of January 2019), training with the same data, to extract the average performance of each of them and being able to compare them. Thus, the best architecture for each structure of lags and to each of the mathematical models used (LSTM or MLP) is obtained.
After finding the best model for each lag architecture analyzed (see Tables 1 and 2 Generally, as the number of time lags considered increases, the complexity of the model needs to change (there is more information to be extracted). Therefore, a process based on repetition (cross validation design; data are divided into training, test and validation [58]) was carried out to find the best parameters for each model and for each of the different lagged architectures studied. This process consists of repeating a prediction of the same test sample 10 times with each model (the second week of January 2019), training with the same data, to extract the average performance of each of them and being able to compare them. Thus, the best architecture for each structure of lags and to each of the mathematical models used (LSTM or MLP) is obtained.
After finding the best model for each lag architecture analyzed (see Tables 2 and 3), the thermal inertia of the building has been tested with two new weeks of 2019 (validation data):

Data Acquisition of the Experimental Case Study
The process of data acquisition, as well as the characteristics of the energy system of the building studied, is described in this section.

Building and HVAC System Description
The case study building where this new methodology has been proved is a public library located in the city of Vigo, in the north west of Spain. It is a three floor building with connected and large open areas that trigger temperature stratification inside the library. The building has a working floor area of 820 m 2 and the average capacity is 220 persons. This total usable floor area includes 412.3 m 2 on the ground floor, 233.5 m 2 on the first floor and 73.0 m 2 on the second floor. Due to the interconnected spaces and the large window area, the building experiences high thermal inertia.
The HVAC system is a ground-source heat pump (GSHP) distributed with a radiant floor (RF). Further information about the building and its HVAC system can be consulted in [43,44,59].

Data Acquisition System
The data acquisition (DAQ) system in the building is further described in other articles by Cacabelos et al. [43,59] and Fernández et al. [44]. The rate of this system is one minute.
There are several wall module temperature sensors; six of them placed in the ground floor, four of them in the first floor and one in the second floor, all of them from the manufacturer Honeywell. In addition, the thermal zone temperature is calculated as the average of temperatures of every sensor from each floor. On the other hand, thermal energy consumption is measured with a thermal energy meter Multical 601 manufactured by Kamstrup.
The meteorological data were gathered from a weather station located at 42.17 • N latitude and 8.68 • E longitude at an altitude of 460 m. This station belongs to the weather station network from the Environment, Land Planning and Infrastructures Department, and it is located only 500 m from the building.
Further information about the DAQ and the weather station can be found in [43,44,59].

Validation and Error Measurement
The error measure considered in this paper to quantify the accuracy of each of the proposed models is the CV(RMSE) (coefficient of variation of the root mean square error): This measure was used both to find the best structure depending on the number of time lags introduced in the models and, also, to compare the different models with the test samples (Tables 2  and 3). It has been used in similar studies such as that of Hong et al. [60] and Kuo et al. [61].

Results and Discussion
The inertia in the thermal conditions of the Science Library of the University of Vigo was analyzed through the variation of the CV(RMSE) (Equation (4)) in the predictions of thermal demand and indoor temperatures of the building. In this analysis the models were trained with two months of hourly observations considering different numbers of time lags (values of certain variables in past hours) with respect to the variables of study to make the predictions. In this way, two specific weeks in 2019 (sample 1 and sample 2) have been taken into account to analyze the thermal inertia of the building by comparing the error obtained by each model according to the number of time lags used. Section 3.1 presents the results to the thermal demand predictions and Section 3.2 the same analysis for indoor temperature predictions. In each section the evolution of the prediction error was analyzed based on the number of hourly time lags introduced in the models. The numerical results are the mean and the standard deviation of the CV(RMSE) obtained in 10 repetitions for each model and sample analyzed. All the specific architectures used in the models are shown in Tables 2 and 3. Lastly, all figures presented in this section were made with the Python programming language [62].

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 deviations below 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%).
Appl. Sci. 2020, 10, x FOR PEER REVIEW 8 of 16 in 2019 (sample 1 and sample 2) have been taken into account to analyze the thermal inertia of the building by comparing the error obtained by each model according to the number of time lags used. Section 3.1 presents the results to the thermal demand predictions and Section 3.2 the same analysis for indoor temperature predictions. In each section the evolution of the prediction error was analyzed based on the number of hourly time lags introduced in the models. The numerical results are the mean and the standard deviation of the CV(RMSE) obtained in 10 repetitions for each model and sample analyzed. All the specific architectures used in the models are shown in Tables 1 and 2. Lastly, all figures presented in this section were made with the Python programming language [62].

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 6. Specifically, the results of the LSTM models are shown in Figure 6a and the results of the MLP models are shown in Figure 6b. 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 1, with average errors of less than 20% and standard deviations below 0.05, in the two samples considered in this study. In sample 1 (first row of Figure 6a) 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 1 and Figure 6a, in this sample the average errors are, in general, higher than those of sample 2. Although in Figure 6a all the models are close to the real values, as only the best predictions of each model are shown, in Table 1 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) 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 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. Table 2. Results of the thermal demand predictions based on the time lags introduced in the neural network model. LSTM errors are presented in the first three columns, whereas MLP errors are presented in the last three. The results shown summarize the 10 repetitions of the experiment, for each architecture and each sample analyzed. The mean of the CV(RMSE) obtained in each of them and the standard deviation (SD) are presented. The different structures of the neural networks that obtain the best accuracy are presented between brackets. 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. Both LSTM and MLP models show that the best fit to reality is obtained from an architecture with 6 lags in sample 1 and 1 lag in sample 2 (see Table 2). Therefore, the inertia influence is greater with the data of sample 1. Moreover, the LSTM models, for both samples, present the worst performance with 12 lags; but the result, although not surpassing the best one, improved by introducing 24 lags. On the other hand, with MLP models the introduction of more time lags than the optimal ones cause an increase in the average error. MLP models obtained the worst time-lag structure in both cases with the 24-lag structure. Thus, although the best MLP models are more accurate than the best LSTSM models, the worst MLP models are less accurate than the worst LSTM models. Regarding the stability of the results obtained, all the models show a small variability and, although there is not much difference between them, MLP models show smaller standard deviations. In addition, the model without time lags in any case obtained the best performance. This means that a thermal inertia exists and that the introduction of time lags in the thermal input variables provides valuable information.

Temperatures Analysis
The analysis of the thermal inertia of the building, for the two samples studied, through the predictions of the indoor temperatures of the building studied, is shown in Figure 5. Specifically, the results of the LSTM models are shown in Figure 5a and the results of the MLP models are shown in Figure 5b. As in the previous section, each time-lag structure studied is represented in the figures through the prediction with the lowest error among the 10 repetitions of the analysis.
LSTM models optimally predict the indoor temperatures of the building analyzed in this study. Table 3 shows that average errors (measured by the CV(RMSE)) are below 3% and their variability is small (below 0.005); both for sample 1 and for sample 2. In sample 1 (first row of Figure 5a), contrary to the previous section, the average errors are lower than those of sample 2. Furthermore, the lowest average error of this sample is obtained with the 1-lag structure (CV(RMSE) = 1.89%). In addition, although the models results are stable, this specific architecture shows the smallest standard deviation among all the structures analyzed (see Table 3). In this case, in Figure 5a it is observed that the two architectures with 12 and 24 lags are straight lines. This fact means that the introduction of more time lags does not provide useful information. Although the average error obtained by these two architectures is small, the models do not efficiently adjust to reality. Thus, the architecture that obtains the highest average error is the architecture with 24 lags (CV(RMSE) = 2.68%). Moreover, it is the least stable model structure in relation to the variability of the errors obtained (see Table 3). There is a correlation between the variability of the errors obtained and the average error; the greater the variability, the greater the average error. On the other hand, in sample 2 (second row of Figure 5a) the 1-lag structure, as in sample 1, obtained the lowest average error (CV(RMSE) = 2.05%) and the smallest variability (see Table 3). As shown in Figure 5(a), with this sample the different models analyzed show a more similar behavior among themselves than in sample 1. Furthermore, unlike the first sample, the introduction of more time lags in the models eventually reduces the average errors; the best models, are those with 1 and 24 time lags (see Table 3). Therefore, the architecture with the highest average error is the 6-lag architecture (CV(RMSE) = 2.23%). In this case, there is no relation between average error and the variability of the results.

Temperatures Analysis
The analysis of the thermal inertia of the building, for the two samples studied, through the predictions of the indoor temperatures of the building studied, is shown in Figure 7. Specifically, the results of the LSTM models are shown in Figure 7a and the results of the MLP models are shown in Figure 7b. As in the previous section, each time-lag structure studied is represented in the figures through the prediction with the lowest error among the 10 repetitions of the analysis. LSTM models optimally predict the indoor temperatures of the building analyzed in this study. Table 2 shows that average errors (measured by the CV(RMSE)) are below 3% and their variability is small (below 0.005); both for sample 1 and for sample 2. In sample 1 (first row of Figure 7a), contrary to the previous section, the average errors are lower than those of sample 2. Furthermore, the lowest average error of this sample is obtained with the 1-lag structure (CV(RMSE) = 1.89%). In addition, although the models results are stable, this specific architecture shows the smallest standard deviation among all the structures analyzed (see Table 2). In this case, in Figure 7a it is observed that the two architectures with 12 and 24 lags are straight lines. This fact means that the introduction of more time lags does not provide useful information. Although the average error obtained by these two architectures is small, the models do not efficiently adjust to reality. Thus, the architecture that obtains the highest average error is the architecture with 24 lags (CV(RMSE) = 2.68%). Moreover, it is the least stable model structure in relation to the variability of the errors obtained (see Table 2). There is a correlation between the variability of the errors obtained and the average error; the greater the variability, the greater the average error. On the other hand, in sample 2 (second row of Figure 7a) the 1-lag structure, as in sample 1, obtained the lowest average error (CV(RMSE) = 2.05%) and the smallest variability (see Table 2). As shown in Figure 7(a), with this sample the different models analyzed show a more similar behavior among themselves than in sample 1. Furthermore, unlike the first sample, the introduction of more time lags in the models eventually reduces the average errors; the best models, are those with 1 and 24 time lags (see Table 2). Therefore, the architecture with the MLP models, presented in Figure 5b, once again provide better results than LSTM models. As shown in Table 3, their average errors are less than 2.5% and their variability is below 0.003. In sample 1 (first row of Figure 5b), the model structure with the lowest average error is the 24-lag structure (CV(RMSE) = 1.73%). On the contrary, the structure that produces the highest average error is the 6-lag structure (CV(RMSE) = 2.06%). In this case, and similarly to LSTM models, there is no direct relation between average error and variability in the results. In addition, as can be seen in the first row of Figure 5b (and the first row of Figure 5a), none of the models are able to replicate the peaks of the indoor temperatures at the weekend. Nevertheless, as shown in Table 3, the models do adjust the data trend efficiently. On the other hand, in sample 2 (second row of Figure 5b), as in LSTM models, the average errors obtained are higher than those of sample 1 (see Table 3). In this case, the architecture that yielded the lowest average error is the 12-lags architecture (CV(RMSE) = 1.90%). Additionally, it is also the architecture that presents the smallest variability among its results. With this sample, the introduction of time lags did provide valuable information because, as shown in Table 3, the best model structures are those with 12 and 24 lags. However, the lag structure that presents the highest average error was 6-lag structure (CV(RMSE) = 2.28%), slightly worse than the average error of the model without any lag. This means that, although the introduction of time lags provides useful information, the basic model (regardless of thermal inertia) already provides good results. Table 3. Results of the indoor temperatures predictions based on the time lags introduced in the neural network model. LSTM errors are presented in the first three columns, whereas MLP errors are presented in the last three. The results shown summarize the 10 repetitions of the experiment, for each architecture and each sample analyzed. The mean of the CV(RMSE) obtained in each of them and the standard deviation (SD) are presented. The different structures of the neural networks that provide the best accuracy are presented between brackets. Regarding the results of the indoor temperatures of the building, it can be observed that, on the one hand, there are less differences between the performance of the models in the different samples than in the case of the thermal demand. Moreover, in comparison with the thermal demand results, the different errors obtained for each of the architectures analyzed during the repetitions are lower and less variable. This demonstrates that indoor temperature values are more constant throughout a year (always around the set point temperature of the building). On the other hand, there are differences between LSTM and MLP models (see Table 3). With LSTM models the thermal inertia is less significant than in the case of thermal demand. In the two samples analyzed the best model was the one with a single time lag. In contrast, with MLP models the thermal inertia is more significant than in the analysis in the previous section. In both samples, the best model structures were a 24-lag structure for sample 1 and a 12-lag structure for sample 2; they use information from a higher number of past hours. In this case, MLP models show better performance in both the best and the worst case. In addition, even with less variability in general concerning indoor temperature predictions, MLP models again produced the lowest standard deviations. Finally, as in the case of thermal demand predictions, models without time lags do not produce the lowest average error in any of the analyses presented. This indicates that the thermal inertia is also significant in the case of indoor temperatures predictions.

Conclusions
A new application of machine and deep learning algorithms and a new methodology to analyze the influence of the thermal inertia of a building are presented in this paper. The study was conducted by analyzing monitored data of thermal demand and indoor temperatures of the Science Library of the University of Vigo. The data were completed with weather variables (outdoor temperatures and solar radiation) and three temporal variables (hour of the day, day of the week and hour of the year). The aim of this analysis is to study the importance of the thermal inertia of the building in predicting thermal demand and indoor temperatures. The methodology used in this study is based, on the one hand, on a classic machine learning model (MLP neural network) contrasting the improvement in the prediction accuracy provided by the thermal inertia of the building. On the other hand, as a comparison, a deep learning model (LSTM neural network) was carried out through an analogous analysis.
The research contribution of this paper is the application of mathematical methods to evaluate the influence of the thermal inertia of the building in the prediction errors of the thermal demand and the indoor temperatures of the building itself. The principal limitation of this research is the analysis of the thermal inertia of the building based on the difference in the errors rates of indoor temperatures depending on the number of time lags. The stable behavior of the indoor temperatures by default, produce that, in general, the prediction error is very low. This makes analysis and detection of the additional information that can provide the introduction of time lags in the models more difficult. On the other hand, the presented methods contribute with advantages over the already existing research in building simulation and thermal inertia analysis of buildings. With traditional building simulations models, both to make predictions and to analyze the thermal inertia of the building, it is necessary to have a deep knowledge about the specific subject and control many different energy parameters. With the methods presented in this paper, known as black box models, it is possible to do all kinds of analyses without any specific knowledge, and also to do it faster than dynamic simulation methods. These models rely on having a significant amount of data to be able to extract information from it and extrapolate it. Additionally, the variables involved in this study are commonly monitored in numerous buildings. Thus, the methodology presented can be applied to evaluate the energy performance or the influence of thermal inertia of different buildings.
First, the results show that the black box models yield average prediction errors below the proposed values for considering calibrated models. The results also illustrate the greater accuracy of MLP neural networks in predicting both thermal demand and indoor temperatures. LSTM neural networks, created specifically to model time sequences, show a poorer performance than MLP models due to the peculiarity of this analysis. In this study the models were trained with only two months of data to try to predict future time sequences of the variable of interest. LSTM models are focused on analyses where predictions are made for time sequences immediately consecutive to the training data (as a time series). In this specific case, where the data are not continuous in time, LSTM models are not the most efficient. In this paper it was demonstrated that, for analyses similar to the one presented here, MLP models are more appropriate; they are more flexible if the available data, on the one hand, are not continuous in time or, on the other hand, are very few. In terms of thermal demand predictions, for both sample 1 and sample 2, the best MLP models are better than the best LSTM models. While the average errors of the MLP models were 14.90% and 14.17%, respectively, the average errors of the LSTM models were 15.26% and 14.35%. The same applies to indoor temperature predictions. The average errors of the best MLP models were 1.73% in sample 1 and 1.90% in sample 2, and those of the best LSTM models were 1.89% and 2.05%, respectively. Regarding the variability of the predictions, the results of the LSTM and MLP models are similar, but the MLP models, in most cases, have slightly smaller standard deviations.
Furthermore, the results of the thermal inertia analysis of the building are different in relation to the different models used. Although all the analyses show that the introduction of specific time lags reduces the prediction error, the influence of the thermal inertia of the building changes with LSTM and MLP models. In the case of thermal demand analysis, both LSTM and MLP models show the same result. In sample 1 the optimal number of time lags introduced in the model was 6 while in sample 2 the optimal structure was a model with 1 time lag. It was demonstrated that the inertia of the independent variables of these models (indoor temperatures, outdoor temperatures and solar radiation) does not extend too much in time. Differently, the results of LSTM and MLP models do not coincide with the indoor temperatures analysis. LSTM models, both of sample 1 and sample 2, have their optimum in 1 time-lag. In contrast, with MLP models the best structures were 24 time lags in sample 1 and 12 time lags in sample 2. Thus, MLP models are able to better extract the information provided by the introduction of more time lags; they are able to exploit the thermal inertia of the building.
From an energy point of view, the conclusion is that the thermal inertia of the building does provide useful information to the machine learning models by introducing lagged variables. This was demonstrated by the decrease, up to a certain limit, of average errors with the introduction of time lags. Therefore, it was also demonstrated that the dimension of the thermal inertia, measured by the maximum number of time lags that provides valuable information, can be detected by the methods presented in this paper. Moreover, the analysis showed that MLP models are more appropriated than LSTM models if the available data set is not large and continuous over time. For the two variables and the two samples analyzed the average error produced by the optimal MLP models are lower than those provide by the optimal LSTM models. Lastly, it was shown that there is more inertia in thermal demand data than in indoor temperatures data; the introduction of thermal demand lags, due to the higher variability of their data, provides more useful information to the models than indoor temperature ones.