# Energy Performance Forecasting of Residential Buildings Using Fuzzy Approaches
## 2 Fuzzy Methodologies
### Adaptive Neuro-Fuzzy Inference System (ANFIS)  
The adaptive neuro-fuzzy inference system, developed by [PERSON], is one of the most popular hybrid neuro-fuzzy systems for function approximation [28]. ANFIS represents a Sugeno-type neuro-fuzzy system. A neuro-fuzzy system is a fuzzy system that uses learning methods derived from neural  
Figure 4: FIR prediction process diagram.  
Figure 3: Derivation of FIR pattern rule base [23].  
networks to find its own parameters. It is relevant that the learning process is not knowledge-based but data-driven, as FIR methodology.  
The main characteristic of the Sugeno inference system is that the consequent, or output, of the fuzzy rules is not a fuzzy set (as are the inputs of the fuzzy rules) but a function, as shown in Equation (1),  
\[\begin{array}{l}\text{R1: If $a$ is $A_{1}$ and $b$ is $B_{1}$ then $z=p_{1}\times a+q_{1}\times b+r_{1}$}\\ \text{R2: If $a$ is $A_{2}$ and $b$ is $B_{2}$ then $z=p_{2}\times a+q_{2}\times b+r_{2}$}\end{array} \tag{1}\]  
where \(a\) and \(b\) are linguistic variables; \(A_{1}\), \(A_{2}\), \(B_{1}\), and \(B_{2}\) are linguistic values determined by fuzzy sets on the universe of discourse of \(A\) and \(B\), and are represented in the form of membership functions; \(p_{1}\), \(q_{1}\), \(r_{1}\), \(p_{2}\), \(q_{2}\), and \(r_{2}\) are parameters of the output functions.  
Figure 5 graphically describes the inference process of a Sugeno model composed by the two rules described in Equation (1). The first step of the Sugeno inference is to combine a given input tuple (in the example of Figure 5: \(a\) = 3 and \(b\) = 2) with the rule's antecedents to determine the degree to which each input belongs to each corresponding fuzzy set (left panel of Figure 5). The \(min\) operator is then used to obtain the weight of each rule, \(w_{i}\), which is used in the final output computation, \(z\) (right panel of Figure 5). Notice that the Sugeno inference has two differentiated sets of parameters. The first set corresponds to the membership function's parameters of the input variables. The second set corresponds to the parameters associated with the output function of each rule, that is, \(p_{i}\), \(q_{i}\), and \(r_{i}\).  
ANFIS is responsible for automatically adjusting these two sets of parameters by means of two optimization algorithms: back-propagation (gradient descendent) and least square estimation. The back-propagation is used to learn the parameters of the antecedents (membership functions) and the least squares estimation is used to determine the coefficients of the linear combinations in the rules' consequents. The ANFIS structure is composed of five layers as shown in Figure 6. ANFIS has \(n\) input nodes, where \(n\) is the number of inputs to the system. In the example of Figure 6, \(n\) is 2 and corresponds to \(a\) and \(b\).  
Layer 1 is the _fuzzification_ layer in which each node represents a membership value to a linguistic term as a Gaussian, triangular, etc. function. The parameters of the selected function are adapted by means of the back-propagation algorithm during the learning stage.  
As the values of the parameters change, the membership function of the linguistic terms, \(A_{i}\) and \(B_{i}\), changes. Layer 2 applies a T-norm operator that performs fuzzy intersection. Layer 3 is a _normalization_ layer that normalizes the strength of all rules, i.e., computes \(\overline{\omega}_{i}=\frac{\omega_{i}}{\sum_{i}\omega_{i}}\). Layer 4 updates the parameters of the consequents of the rules by a learning step based on the least squares approximation algorithm. Finally, Layer 5 performs the summation of the outputs of the nodes in  
Figure 5: Example of how a Sugeno model works (evaluation of two fuzzy rules with two input variables or antecedents, \(a\) = 3 and \(b\) = 2) [28].  
Layer 4. ANFIS is a function of the Fuzzy toolbox that runs under the Matlab environment. For a more detailed explanation of the ANFIS methodology refer to [PERSON] et al. [28].