## 2 Materials and Methods
### Adaptive Neuro-Fuzzy Inference System (ANFIS)  
Neuro-Flous systems combine the advantages of two complementary techniques (Fuzzy system and neural network). Fuzzy systems provide a good representation of knowledge. The integration of neural networks within these systems improves their performance because of the learning capacity of neural networks.  
ANFIS is an optimization method for Takagi and Sugeno's-type fuzzy inference system, based on the use of multilayer networks. ANFIS uses least squares estimation (LSE) combined with the gradient descent backpropagation methods to model a training data set (Figure 6) [51; 52; 53].  
The rule base contains one fuzzy if-then-rule of Takagi and Sugeno's type (with X the input and f the output data).  
Rule: If x is A1, then f\({}_{1}=\mathrm{pl}\,\mathrm{x}+\mathrm{rl}\)  
\begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Value** \\ \hline Optimizer & Adam \\ Epoch & 250 \\ Learning rate & 0.0001 \\ Hidden units & 200 \\ Gradient threshold & 0.01 \\ Layers & Regression \\ Input size & 1 \\ Output response size & 1 \\ \hline \end{tabular}
\end{table}
Table 2: Training hyper-parameters for LSTM.  
Figure 6: ANFIS structure for one input variable.  
where \(f_{i}\) is the fuzzy inference according to the desired output:  
\[\mu_{Ai}(x)=e^{-(\frac{x-z_{i}}{z_{i}^{i}})^{2}} \tag{13}\]  
where \([a_{i},c_{i}]\) is the parameter set. ANFIS uses a 5-layer MLP (Multilayer perceptron) as following described:  
Layer 1: Generating degree of membership:  
\[O_{1,i}=\mu_{Ai}(x) \tag{14}\]  
The first layer of an ANFIS-type architecture comprises as many neurons as there are fuzzy subsets in the inference system represented. Each neuron calculates the degree of truth of a particular fuzzy subset by its transfer function. The activation function of neurons i of the first layer is \(O_{1,i}\); x is the input to neuron i, and Ai is a fuzzy subset corresponding to x. \(O_{1,i}\) is the membership function of Ai and indicates the degree to which a given x satisfies the quantifier Ai. We choose \(\mu_{Ai}(x)\) to be in the Gaussian form.  
Layer 2: Fuzzy intersection:  
The outputs of this layer are the weights \(w_{i}\) of the rules; they are obtained by a simple multiplication of the inputs in each cell. The neurons receive as input the truth degree of the different fuzzy subsets making up this premise and are responsible for calculating their truth degree. The activation functions used for these neurons depend on the operators present in the rules (AND or OR).  
The activation function of neurons i of this layer is the following:  
\[O_{2,i}=w_{i}=\mu_{Ai}(x)\cdot\mu_{Bi}(x),\;i=1,2 \tag{15}\]  
Layer 3: Normalization:  
This layer corresponds to the normalization of the weights of the rules. It calculates the ratio between the weights \(w_{i}\) of the rule and the sum of all the weights of the rules.  
\[O_{3,i}=\overline{w_{i}}=\frac{w_{i}}{w_{1}+w_{2}}\;i=1,2 \tag{16}\]  
Layer 4: Defuzzification:  
Each node i in this layer is calculated as reported in Equation (17); \(\overline{w_{i}}\) are the outputs of layer 3, whereas \(p_{i}x+r_{i}\) are the consequent parameters of the output function.  
\[O_{4,i}=\overline{w_{i}}f_{i}=\overline{w_{i}}(p_{i}x+r_{i}) \tag{17}\]  
Layer 5: The output layer:  
The cell represents the sum of all the input signals and therefore returns, at the output, the approximate value of the desired function.  
\[O_{5,i}=\sum\;\overline{w_{i}}f_{i} \tag{18}\]  
Table 3 illustrates our training parameter of the ANFIS software.