# A Data-Driven Forecasting Strategy to Predict Continuous Hourly Energy Demand in Smart Buildings
## 2 Data and Preliminary Process  
### Data Collection  
For this research, data from two buildings located on the campus of the University of Valladolid, Spain was used. The historical data of the energy consumption from 2016 to 2019 in 15 min intervals, was obtained through smart meters located in each of the buildings. Even though both buildings are located on a university campus, building 1 is more focused on administrative use where office areas are located in most of the building. In the case of building 2, the use is mixed, since there are classrooms, offices, and a library. Figure 1 shows the energy consumption and the overall pattern of each building throughout the timeframe analyzed.  
The climatic data used for the construction of the dataset were obtained through NASA Prediction of Worldwide Energy Resources [19]. As the research is focused on sustainable buildings, variables that influence occupant comfort within buildings were considered. The following variables were considered for the training of the models: heating degree days below 18.3 \({}^{\circ}\)C (HDD18_3), cooling degree days above 0 \({}^{\circ}\)C (CDD0), cooling degree days above 10 \({}^{\circ}\)C (CDD10), precipitation (PRECTOT), relative humidity at 2 m (RH2M), the temperature at 2 m (T2M), the temperature at 2 m minimum (T2M_MIN), the temperature at 2 m maximum (T2M_MAX), and all-sky surface longwave downward irradiance (ALLSKY). An exploratory analysis of the data was made through a correlation heatmap to determine the relationship between the variable to be predicted (ENERGY) and the climatic variables, which is shown in Figure 2.  
Figure 1: (**a**) Energy consumption and general trends of building 1; (**b**) energy consumption and general trends of building 2.  
Figure 2 shows that there is a positive correlation with the variables HDD18 3, PRECTOT, RH2M and a negative correlation with the variables CDD0, CDD10, T2M, T2M_MIN, T2M_MAX, and ALLSKY. Similarly, it is observed that the correlations in both cases are weak. Therefore, it would be important to carry out another analysis to conclude which variables could contribute to the models.  
In addition to the aforementioned data, the academic calendar of each year was obtained to use this information to determine the occupancy of the buildings considering the periods where occupancy is minimal.  
Finally, an analysis to determine which values of the past series would be more useful to predict future values was carried out using autocorrelation function (ACF) and partial autocorrelation function (PACF).  
Figure 3 shows the analysis performed for each building. It is observed in the autocorrelation graph that both datasets present patterns of seasonality, indicating that the use of autoregression models would be appropriate. In the partial autocorrelation graph, it is observed that until lag 25, there is significant autocorrelation in the time series, which would be important to consider for the models.  
Figure 2: (**a**) Correlation heatmap between climatic variables for building 1; (**b**) correlation heatmap between climatic variables for building 2.