# Failure Prediction of the Rotating Machinery Based on CEEMDAN-ApEn Feature and AR-UKF Model
## 2 Methodology
### RUL Prediction  
#### 2.4.1 Unscented Kalman Filter  
The Unscented Kalman Filter (UKF) is an algorithm which can approximate the probability density function of variables. Based on the unscented transformation and Kalman linear filtering framework, UKF can address the particle degradation problem with deterministic sampling strategy. Details of UKF is introduced as follows.  
A matrix \(Q\) with \(2n+1\) elements (sigma points) is generated as follows.  
\[Q^{i}=\left\{\begin{array}{ccc}\mu_{q}&&,i=0\\ \mu_{q}+\left(\sqrt{\left(n+\lambda\right)c_{q}}\right)&&,\ i=1,2,...,n\\ \mu_{q}-\left(\sqrt{\left(n+\lambda\right)c_{q}}\right)&,\ i=n+1,n+2,...,2n \end{array}\right., \tag{20}\]  
where \(\mu_{q}\) and \(c_{q}\) are the mean and the covariance of \(n\)-dimensional random variables. \(\lambda=\alpha^{2}\left(n+\kappa\right)-n\) is the scale factor, where \(\kappa\) should satisfy the condition of the matrix \(\left(n+\lambda\right)c_{q}\) being a semi positive definite matrix.  
Then, each sigma point should be modified as follows.  
\[\left\{\begin{array}{ccc}W^{j}=\left\{\begin{array}{ccc}\lambda/\left(n+ \lambda\right)&&,j=0\\ 1/2\left(n+\lambda\right)&&,j=1,2,...,2n\\ W_{c}^{j}=\left\{\begin{array}{ccc}\lambda/\left(n+\lambda\right)+\left(1-v ^{2}+\tau\right)&&,j=0\\ 1/2\left(n+\lambda\right)&&,j=1,2,...,2n\end{array}\right.\end{array}\right. \tag{21}\]  
where \(W^{j}\) and \(W_{c}^{j}\) represent the weights of mean and covariance, respectively. \(v\) is the zooming factor, and \(\tau\) contains higher order moment information for the prior distribution.  
Suppose the state space model of the nonlinear system is as follows.  
\[s_{k+1}=f\left(s_{k}\right)+w_{k}, \tag{22}\]  
\[o_{k}=h\left(s_{k}\right)+v_{k}, \tag{23}\]  
where \(s_{k}\) is \(n\)-dimensional state vector, and \(o_{k}\) is observation vector. \(f\left(\bullet\right)\) and \(h\left(\bullet\right)\) are the state transition function and measurement function, respectively. \(w_{k}\) and \(v_{k}\) represent uncorrelated zero-mean white noise, in which the covariance is \(cs_{k}\) and \(co_{k}\), respectively.  
Suppose \(O^{i}=f\left(S^{i}\right)\) is the output of above nonlinear system with the input \(S^{i}\), and \(\mu_{o}\) and \(c_{o}\) are its mean and covariance, respectively. UKF is divided into a prediction step and an update step. The prediction step is introduced as follows:  
\[S^{i}_{k|k-1}=f\left(S^{i}_{k-1|k-1}\right)\ \,i=0,1,...,2n, \tag{24}\]  
\[O^{i}_{k|k-1}=h\left(S^{i}_{k|k-1}\right)\ \,i=0,1,...,2n, \tag{25}\]  
\[\widehat{s}_{k|k-1}=\sum_{i=0}^{2n}W^{i}S^{i}_{k|k-1}, \tag{26}\]  
\[\widehat{o}_{k|k-1}=\sum_{i=0}^{2n}W^{i}O^{i}_{k|k-1}, \tag{27}\]  
\[c_{k|k-1}=cs_{k}+\sum_{i=0}^{2n}W^{i}_{c}\left(S^{i}_{k|k-1}-\widehat{s}_{k|k-1 }\right)\left(S^{i}_{k|k-1}-\widehat{s}_{k|k-1}\right)^{T}. \tag{28}\]The update step is described as follows.  
\[c_{o}=co_{k}+\sum_{i=0}^{2n}W_{c}^{i}\left(O_{k|k-1}^{i}-\widehat{\sigma}_{k|k-1 }\right)\left(O_{k|k-1}^{i}-\widehat{\sigma}_{k|k-1}\right)^{T}, \tag{29}\]  
\[c_{so}=\sum_{i=0}^{2n}W_{c}^{i}\left(S_{k|k-1}^{i}-\widehat{s}_{k|k-1}\right) \left(O_{k|k-1}^{i}-\widehat{\sigma}_{k|k-1}\right)^{T}, \tag{30}\]  
\[K_{k}=c_{so}c_{o}^{-1}, \tag{31}\]  
\[\widehat{s}_{k|k}=\widehat{s}_{k|k-1}+K_{k}\left(o_{k}-\widehat{\sigma}_{k|k-1 }\right), \tag{32}\]  
\[c_{k|k}=c_{k|k-1}-K_{k}c_{o}K_{k}^{T}. \tag{33}\]