## 2 Materials and Methods
### Artificial Neural Networks  
ANN are a well-known strategy to predict consumptions [24]. ANN are inspired by the way biological neurons of the human brain process information and are composed by several single and highly interconnected processors. An input node receives the contribution of adopted features and the last layer (the output layer) provides the information derived from the network (predicted values as the main goals of ANN for regression purposes). Between the input and output layer, one or more intermediate layers (hidden layers) are considered, and in these different number of neurons can be adopted, according to the real time series complexity. For each connection between elements, weights links are responsible to pass information signals from each unit to the next (respecting a feed-forward typology). A training stage is needed to provide the effectiveness of the model when comparing predicted values with the real ones. To do that, an error metric is used as an objective function that must be minimized in each iteration, sending the error to precedent layers and enabling a weights' update (backpropagation).  
Their ability to deal with non-linear relationships between inputs and outputs (possible when nonlinear transfer functions are adopted) and the option to predict different load records simultaneously (when adopting a single model multivariate forecasting) make ANN very suitable to forecast a daily load profile. For that reason, they are being adopted by several researchers to predict building energy consumptions [3; 15; 21]. Some drawbacks that are often pointed out are the inherent empirical process (based on trial-error experiments, mostly depending on random ANN parameters' initialization), considerable risk of reaching local minima, and high dependence on a proper structure selection or even on a feature selection/extraction stage.  
In this study, ANN were parameterized as follows:  
* Hidden layer activation function: hyperbolic tangent;
* Weight optimization solver: \"_Adam_\";
* Number of hidden layers: 1;
* Number of neurons: 40;
* Data training/validation ratio: 80%/20%.  
The Adam optimization algorithm, which is an alternative to classical stochastic gradient descent, was used to update network weights since it is particularly efficient when handling large datasets, with a reasonable trade-off between training times and prediction accuracy. A single hidden layer was used as that is the most widely recommended choice to represent any type of function, with the approximation ability dependent on both the choice of activation functions and the number of neurons. The number of neurons was selected after ten-time ANN training trials using ten, twenty, thirty, forty and fifty neurons, following the best results (i.e., lowest error metrics); simulations with fewer neurons led to underfitting (lower ability to estimate heating/cooling), while higher number of neurons led to overfitting (generalization loss, lower ability to estimate new values). Figure 2 presents an example of an ANN model's structure based only on historical records (in this case, congenerous days, one week and two weeks before) and exogenous variables (in the example, temperature).  
\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Feature** & **H1** & **H2** & **H3** & **H4** & **H5** & **H6** \\ \hline Historical heating load from 1 week before [kW] & X & & X & X & X & X \\ Historical heating load from 2 weeks before [kW] & X & & X & X & X & X \\ Outdoor air temperature [\({}^{\circ}\)C] & & X & X & X & X & X \\ Wind speed [m/s] & & X & & & & \\ Direct normal solar radiation [kW] & & & & X & \\ Diffuse horizontal radiation [kW] & & & & & X & \\ Relative humidity [\%] & & X & & & & X \\ \hline \hline \end{tabular}
\end{table}
Table 2: Sets of features tested for heating energy demand forecast.