## 3 Problem Formulation
### Long Short-Term Memory (LSTM)  
Taking into account the above, and as indicated in Section 2 (Related works), a model based on LSTM is suitable for the development of models for time series predictions, as they have a better capacity to deal with temporal dependencies as well as the detection of complex patterns, which are inherent in HVAC data in buildings [51; 63]. In other  
Figure 1: Management of the building environment and the HVAC system using a BMS.  
words, LSTM networks have greater robustness for the handling of continuous values and present good performance with time series data of large time lags [25]. Within this context, this neural network offers a solution to the two main problems that RNNs present at the moment of learning: (i) it is not able to consider time lags far from the time series and (ii) it tends to present unstable gradients (vanishing or exploding) [4; 29; 55].  
The LSTM network, which is an improved variant of RNN, was first introduced in 1997 by [PERSON] and [PERSON] [27; 56] and has been widely used for the analysis and prediction of time series or sequential data, such as: voice recognition, electrocardiograms, stock price, etc. [64]. This network is composed of a memory cell state denoted by (C\({}_{t}\)) and three main gates called forget gate (F\({}_{t}\)), input gate (I\({}_{t}\)), and output gate (O\({}_{t}\)), as shown in Figure 2.  
These gates function as valves to manage and control the information learned during training. More specifically, the forget gate determines what information to remove or keep from the memory cell; the input gate selects the information from the candidate memory cell state (C\({}_{t}^{*}\)) to update the cell state; the output gate decides the information from the memory cell so that the model only considers meaningful information to predict. The values for each of these gates are calculated according to the following equations  
\[\text{I}_{t} =\text{sigmoid}(\text{W}_{i}\cdot\left[\text{y}_{t-1},\text{X}_{t }\right]+\text{b}_{i}) \tag{1}\] \[\text{F}_{t} =\text{sigmoid}(\text{W}_{t}\cdot\left[\text{y}_{t-1},\text{X}_{ t}\right]+\text{b}_{f})\] (2) \[\text{O}_{t} =\text{sigmoid}(\text{W}_{o}\cdot\left[\text{y}_{t-1},\text{X}_{ t}\right]+\text{b}_{o})\] (3) \[\text{C}_{t}^{*} =\text{tanh}(\text{W}_{c}\cdot\left[\text{y}_{t-1},\text{X}_{ t}\right]+\text{b}_{c}) \tag{4}\]  
The memory cell (C\({}_{t}\)) and output (y\({}_{t}\)) values of the LSTM network are calculated using the following equations  
\[\text{C}_{t} =(\text{C}_{t-1}\cdot\text{F}_{t})+(\text{C}_{t}^{*}\cdot\text{I}_ {t}) \tag{5}\] \[\text{y}_{t} =\text{O}_{t}*\text{tanh}(\text{C}_{t}) \tag{6}\]  
where \(\text{W}_{(i,\text{ }t,\text{ }o,\text{ C})}\), and \(\text{b}_{(i,\text{ }t,\text{ }o,\text{ C})}\) represent the weights and bias variables, respectively, of the three gates and the memory cell state, y\({}_{t-1}\) is the previous hidden unit information, and Xt is the value of the current input. Thus, the use of these gates allows the LSTM network to have the ability to learn long-term dependencies in the input sequence.  
Now, for the development of the LSTM-based model, we consider different data from the building BMS system. Some of these data come from the environment, HVAC system, and building. By supplying the information as a time series to the model, the model will  
Figure 2: Diagram of the internal structure of an LSTM network.  
predict the behavior and energy consumption of the building's HVAC system. Therefore, building administrators/managers will obtain information to carry out the aforementioned intelligent strategies.