# Fault Diagnosis Method Based on Time Series in Autonomous Unmanned System
## 4 Fault Diagnosis Method Using Improved Clustering Algorithm  
### Time Series Symbolic Representation Based on Gaussian Mixture Clustering  
For the above problem Q1, considering the distribution characteristics of sensor data, the Gaussian mixture clustering is adopted to represent symbolically. This clustering method is used to select the segmented points of the symbol interval, which has better adaptability to the data with unknown distribution.  
The Gaussian mixture model is a probability distribution model with the following form:  
\[P_{GMM}(x|\theta)=\sum\
olimits_{i=1}^{k}\alpha_{i}\cdot p(x|\theta_{i}) \tag{1}\]  
where \(\alpha_{i}>0\) is the mixed component of the \(i\)-th Gaussian distribution, and \(\sum\
olimits_{i=1}^{k}\alpha_{i}=1p(x|\theta_{i})\) is the density of the Gaussian distribution, \(\theta_{i}=\left(\mu_{i},\sigma_{i}^{2}\right)\), where \(\mu_{i},\sigma_{i}^{2}\) are the location parameters and scale parameters of the \(i\)-th Gaussian distribution corresponding to the sub-model are as follows:  
\[p(x|\theta_{i})=\frac{1}{\sqrt{2\pi}\sigma_{i}}e^{-\frac{(x-\mu_{i})^{2}}{2 \sigma_{i}^{2}}} \tag{2}\]  
The Gaussian mixture clustering algorithm is a prototype-based clustering method that uses a probability model to describe the clustering prototype. The core idea is to initialize the Gaussian mixture distribution model and then use the EM algorithm to update the model iteratively.  
The Algorithm 1 is shown as follows.  
Figure 1: Flow chart.  
```
Input: sample set \(\mathbf{D}=\{\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{m}\}\), the number of Gaussian mixture components \(\mathbf{k}\); Output: cluster partition \(\mathbf{C}=\{\mathbf{C}_{1},\mathbf{C}_{2},\ldots,\mathbf{C}_{k}\}\);
1. initialize the parameter set of Gaussian mixture model \(\{(\alpha_{i},\mu_{i},\sigma_{i})|1\leq i\leq k\}\)
2. repeat
3. for\(\mathbf{x}_{j}\)\((1\leq j\leq m)\)do
4. calculate the posterior probability \(E\Big{(}\gamma_{ji}\Big{)}\) generated by the i-th Gaussian distribution \[E\Big{(}\gamma_{ji}\Big{)}=\frac{\alpha_{i}\cdot p\Big{(}x_{j}\Big{|}\mu_{i} \cdot\sigma_{i}^{2}\Big{)}}{\sum_{l=1}^{k}\alpha_{i}\cdot p\Big{(}x_{j}\Big{|} \mu_{l},\sigma_{i}^{2}\Big{)}}\]
5. endfor
6. for i = 1,2,..., k do
7. update the mixing coefficient, position parameters and scale parameters for each Gaussian distribution model: \[\alpha_{i}^{{}^{\prime}}=\frac{\sum_{j=1}^{m}E\Big{(}\gamma_{ji}\Big{)}}{m} ;\mu_{i}^{{}^{\prime}}=\frac{\sum_{j=1}^{m}E\Big{(}\gamma_{ji}\Big{)}x_{j}}{ \sum_{j=1}^{m}E\Big{(}\gamma_{ji}\Big{)}}\] \[\sigma_{i}^{2^{\prime}}=\frac{\sum_{j=1}^{m}E\Big{(}\gamma_{ji}\Big{)}\Big{(}x_{ j}-\mu_{i}^{{}^{\prime}}\Big{)}^{2}}{\sum_{j=1}^{m}E\Big{(}\gamma_{ji}\Big{)}}\]
8. endfor
9. update the parameter setof Gaussian mixture model \(\{(\alpha_{i},\mu_{i},\sigma_{i})|1\leq i\leq k\}\) to \(\Big{\{}\Big{(}\alpha_{i^{\prime}}^{{}^{\prime}}\mu_{i^{\prime}}^{{}^{\prime} }\sigma_{i}^{{}^{\prime}}\Big{)}\Big{|}1\leq i\leq k\Big{\}}\)
10. until the end of the iteration
11. for j = 1,2,..., m do
12. \(\lambda_{j}=arg\max\limits_{i\in\{1,2,...,k\}}\gamma_{ji}\)
13. \(\mathbb{C}_{\lambda_{j}}=\mathbb{C}_{\lambda_{j}}\cup\Big{\{}x_{j}\Big{\}}\)
14. endfor
```  
**Algorithm 1** Gaussian mixture clustering algorithm  
The time series symbolic representation based on Gaussian mixture clustering is to conduct Gaussian mixture clustering on all sample points and use the label obtained by clustering to symbolize the value at a certain time so as to achieve the dimensional reduction of the original time series.  
This method can adapt well to the time series data provided by the autonomous unmanned system, which is subject to Gaussian mixture distribution. The model is simple and easy to understand, and the time complexity is relatively low.