## 3 Adaptive Neural Fuzzy Model
### ANFM Learning Algorithm
#### 3.2.1 Generation of Fuzzy Rules  
In ANFM, the number of fuzzy rules directly affects the identification ability of the system. Too few fuzzy rules will not fully encompass the input/output state space and the performance of ANFM will deteriorate; too many fuzzy rules will increase the complexity of the system and lead to poor generalization of ANFM. Therefore, output error is an important factor in determining whether a new rule should be generated. For the \(i\)th observation \((X_{i},o_{i})\), where \(X_{i}\) is the input vector and \(o_{i}\) is the desired output, the full output \(y_{i}\) of the existing structure of ANFM can be calculated according to Equation (12). \[\|e_{i}\|=\|o_{i}-y_{i}\| \tag{13}\]  
If \(\|e_{i}\|>k_{e}\), add a new rule. Here \(k_{e}\) is the error index, the value of which is predetermined according to the desired accuracy of ANFM. In addition, the coverage of the Gaussian function is another important factor in determining whether a new rule should be added. For the \(i\)th observation \((X_{i},o_{i})\), calculate the distance \(d_{i}(j)\) between the input value \(X_{i}\) and the centre \(C_{j}\) of the existing RBF neural unit, that is  
\[d_{i}(j)=\|X_{i}-C_{j}\| \tag{14}\]  
Find out  
\[d_{min}=argmin(d_{i}(j)) \tag{15}\]  
and this \(d_{min}\) is the coverage scope. If \(d_{min}>k_{d}\), a new fuzzy rule should be considered. Otherwise, the observed data \(X_{i}\) can then be represented by the nearest available RBF neural unit. Here \(k_{d}\) denotes the effective radius of \(d_{min}\). Thus, the error index \(k_{e}\) and the effective radius \(k_{d}\) play important roles in determining the generation of new rules. In this paper, we adopt the idea of \"graded learning\" [61], based on a monotonically decreasing function, gradually reducing the error index \(k_{e}\) and the effective radius \(k_{d}\) of each RBF neural unit as follows. \[k_{e}=max[e_{max}\times\beta^{i},e_{min}] \tag{16}\]  
\[k_{d}=max[d_{max}\times\gamma^{i},d_{min}] \tag{17}\]  
where \(e_{max}\) is the predefined maximum error, \(e_{min}\) is the desired accuracy of ANFM, and \(0<\beta<1\) is the convergence constant; \(d_{max}\) is the maximum length of the input space, \(d_{min}\) is the minimum length, and \(0<\gamma<1\) is the decay constant. These parameters will be set prior to the ANFM learning. The key idea of graded learning is to first determine the position that generates a large output error without being covered by the existing fuzzy rules. This stage is called rough learning. When \(k_{e}\) and \(k_{d}\) reaches \(e_{min}\) and \(d_{min}\), respectively, this stage is called detailed learning. Because the width of the RBF unit is very important for the generalization capacity of the system, the width is too small to fully divide the input space, making the system's generalization ability worse. The width is too large and easily falls into saturation, and the correct output cannot be produced. Therefore, the initial parameters of the new rules are determined by the formulas. \[C_{i}=X_{i} \tag{18}\]  
\[\sigma_{i}=k_{s}\times d_{min} \tag{19}\]  
where, \(k_{s}\) is a predetermined overlap factor; the width of the first rules is also a pre-set constant. From (16) and (17), it can be seen that graded learning is the transition process from rough to detailed learning. Only when \(\|e_{i}\|>k_{e}\) and \(d_{min}>k_{d}\), an additional fuzzy rule is needed. For the other three cases, the followings are discussed:  
1. \(\|e_{i}\|\leq k_{e}\) and \(d_{min}\leq k_{d}\), ANFM can fully accommodate the observation data, no need to do anything;
2. \(\|e_{i}\|\leq k_{e}\) and \(d_{min}>k_{d}\), this situation indicates that the establishment of ANFM has a good generalization ability, and only the parameters of the post-rules need to be adjusted;
3. \(\|e_{i}\|>k_{e}\) and \(d_{min}\leq k_{d}\), this situation indicates that the generalization ability of the RBF neural unit covering \(X_{i}\) is not very good. Therefore, the RBF neural unit and results parameters will be updated at the same time.