## 2 Theoretical Basis
### Adaptive Neuro-Fuzzy Inference System  
The Adaptive Neuro-Fuzzy Inference System (ANFIS) is a blend of the neural network and fuzzy inference system. Fuzzy inference systems have no learning capabilities regarding the input-output space and no standard tuning methods for their rule bases, which make system adaptations difficult. The ANFIS technique offered a method for the fuzzy systems to acquire knowledge regarding the dataset to calculate the membership function parameters that permitted Fuzzy Inference System (FIS) for automatic system adaption. ANFIS architecture is a superimposition of FIS on the Artificial Neural Network (ANN) architecture, which will enable FIS to optimise its rule base based on the output to learn like an ANN eliminating its inherent disadvantage. The ANFIS algorithm has an in-built advantage compared to fuzzy models as it holds the learning competencies of the ANN, which augments the system performance using a priori understanding [17]. Using an input and output space relation, ANFIS forms an FIS, the membership function of which is altered by exploiting the back-propagation algorithm and least square method available with ANN [18]. In this section, the ANFIS architecture and its learning algorithm for the Sugeno fuzzy model will be described primarily. The ANFIS architecture is shown in Figure 2; ANFIS normally has five layers of neurons, of which neurons in the same layer are of the same function family. Assume that the FIS under consideration has two inputs, \(x\) and \(y\), which form two fuzzy if-then rules based on first-order Sugeno fuzzy model [19]. Rule 1: If \(x\) is A1 and \(y\) is B1, then \(f1=p1x+q1y+r1\);  
Rule 2: If \(x\) is A2 and \(y\) is B2, then \(f2=p2x+q2y+r2\);  
where \(p1\), \(p2\), \(q1\), \(q2\), \(r1\), and \(r2\) are linear parameters and A1, A2, B1, and B2 are nonlinear parameters. The output of the \(i\)th node in layer 1 is denoted as \(O_{i,i}\). Layer 1: Every adaptive node \(i\) in the layer 1 has a node function. \[O_{i,i}=\mu_{A_{i}}(x)\ for\ i=1,\ 2,\ or\ O_{i,i}=\mu_{B_{i-2}}(y)\ for\ i=3,\ 4 \tag{2}\]  
where \(x\) (or \(y\)) is the input to nodes \(i\) and \(A_{i}\) (or \(B_{i-2}\)) generating a linguistic label coupled with the node as given by Equation (2). The membership function for \(A\) (or \(B\)) can be any, parameterized as a sigmoidal membership function given by Equation (3). \[\mu_{A_{i}}(x)=\frac{1}{1+e^{-a(x-c)}} \tag{3}\]  
where \((c_{i},a_{i})\) is the parameter set. These are called premise parameters. As the values of the parameters change, the shape of the membership function varies. Layer 2: Every node in layer 2 is a fixed node labelled \(\prod\). Each node calculates the firing strength of each rule, which is the output using the simple product operator. Evaluating the rule premises results as a product of all of the incoming signals given by Equation (4)  
\[O_{2,i}=w_{i}=\mu_{A_{i}}(x)\ \times\ \mu_{B_{i}}(y)\ for\ i=1,2 \tag{4}\]  
Layer 3: The ratio of the \(i\)th rule's firing strength to the sum of all of the rule's firing strengths is calculated by Equation (5) in layer 3. The output of this layer is called normalized firing strengths. \[O_{3,i}=\overline{w}_{i}=\frac{w_{i}}{\Sigma_{i}^{2}w_{i}}=\frac{w_{i}}{w_{1}+w_{2 }}\ i=1,2 \tag{5}\]  
Layer 4: Every node \(i\) in layer 4 is an adaptive node with a node function. The nodes compute a parameter function on the layer output. Parameters in this layer will be referred to as consequent parameters. \[O_{4,i}=\overline{w}_{i}f_{i}=\overline{w}_{i}(p_{i}x+q_{i}y+r_{i}) \tag{6}\]  
where \(w_{i}\) is a normalised firing strength from layer 3 and (\(p_{i}\), \(q_{i}\), \(r_{i}\)) is the parameter set for the node. Layer 5: This layer has a fixed single node labelled \(\Sigma\), which computes the overall output as the summation of all of the incoming signals, as shown in Equation (7). The \(\Sigma\) gives the overall output of the constructed adaptive network, having same functionality as the Sugeno fuzzy model.