# Self-Organized Fuzzy Neural Network Nonlinear System Modeling Method Based on Clustering Algorithm
## 3 Implementation of Modeling Methods
### Self-Organizing Mechanism
#### 3.1.4 Merging of Network-Rule Neurons  
After completing the adjustment of neuron width or updating the parameters, sometimes one or more pairs of neurons become highly similar. In order to obtain a highly compact model and avoid overfitting, a similarity calculation is required. [PERSON] et al. [30] developed two methods of merging rules to eliminate local redundancy; the first is to merge the overcoincident clusters in the clustering space, and the other is to calculate the projection overlap of fuzzy sets in different dimensions, to merge any similar fuzzy sets. We belong to the second method, which calculates the similarity index of different input dimensions separately, so only the similarity index and the largest pair of neurons in all input dimensions will be merged. The similarity is calculated, mainly referring to the method in [31,32], where the ratio of the intersection and concatenation between a pair of neurons is defined as the similarity:  
\[S(A,B)=\frac{\sum\limits_{i=1}^{n}M(A_{i}\cap B_{i})}{\sum\limits_{i=1}^{n}M(A _{i}\cup B_{i})}, \tag{27}\]  
where \(S(A,B)\) represents the similarity between A and B fuzzy set, and Equation (27) indicates the intersection of A and B, rather than the concatenation of A and B.  
As shown in Figure 4, Gaussian function \(A(x)\) intersects with Gaussian function \(B(x)\) at points \(X_{1}\) and \(X_{2}\), and their centers are \(C(a)\) and \(C(b)\), respectively. The intersection of A and B is the area where the two Gaussian functions intersect:  
\[\begin{array}{rl}M(A_{i}\cap B_{i})&=\int_{a_{i}}^{b_{i}}\mu_{A_{i}\cap B_{i }}(x_{i})dx_{i}\\ &=\int_{a_{i}}^{X_{1}}\mu_{A_{i}}(x_{i})dx_{i}\\ &\quad+\int_{X_{1}}^{X_{2}}\mu_{B_{i}}(x_{i})dx_{i}\int_{X_{2}}^{b_{i}}\mu_{A_ {i}}(x_{i})dx_{i},\end{array} \tag{28}\]  
\[\begin{array}{rl}M(A_{i}\cup B_{i})&=\int_{a_{i}}^{b_{i}}\mu_{A_{i}\cup B_{i }}(x_{i})dx_{i}\\ &=\int_{a_{i}}^{X_{1}}\mu_{B_{i}}(x_{i})dx_{i}\\ &\quad+\int_{X_{1}}^{X_{2}}\mu_{A_{i}}(x_{i})dx_{i}\int_{X_{2}}^{b_{i}}\mu_{B_ {i}}(x_{i})dx_{i},\end{array} \tag{29}\]  
Figure 4: Relative position diagram of neurons A and B.  
According to [31], the integral item \(\int_{a}^{b}\mu_{A}(x)dx\) with Gaussian function \(\mu_{a}(x)\) can be calculated by the Gaussian error function, thus improving the computational efficiency:  
\[\int_{a}^{b}\mu_{A}(x)dx=\frac{\sigma_{A}\sqrt{\pi}}{2}\left[erf(\frac{b-c_{A}}{ \sigma_{A}})-erf(\frac{a-c_{A}}{\sigma_{A}})\right], \tag{30}\]  
\[erf(x)=1-\frac{1}{\left(1+a_{1}x+a_{2}x^{2}+a_{3}x^{3}+a_{4}x^{4}\right)^{4}}, x\geq 0, \tag{31}\]  
where \(a_{1}\) = 0.278393, \(a_{2}\) = 0.278393, \(a_{3}\) = 0.278393, and \(a_{4}\) = 0.278393.  
Calculate the similarity between each center and find the maximum value,  
\[S_{qw}=\arg\max_{0\leq i,j\leq m}S_{ij}, \tag{32}\]  
where \(q\) and \(w\) are the labels of similar neurons.  
If the similarity of a pair of neurons is larger than the threshold, it means that there is a redundancy of centers, and we merge them into one with the number of neurons minus one, as shown in Figure 5, merging two neurons into one.  
\[S_{qw}>S_{th}. \tag{33}\]  
The merged neuron is the mean value of the original neuron:  
\[c_{new}=\frac{(c_{q}+c_{W})}{2}, \tag{34}\]  
\[\sigma_{new}=\frac{(\sigma_{q}+\sigma_{W})}{2}, \tag{35}\]  
\[w_{new}=\frac{(w_{q}+w_{W})}{2}, \tag{36}\]  
\[density\_pot_{new}=\frac{(density\_pot_{q}+density\_pot_{W})}{2}. \tag{37}\]