## 3 RUL Prediction Methodology
### Bayesian RUL Prediction Based on Extended Kalman Filter
#### 3.4.4 EKF-Based RUL Prediction Algorithm  
The EKF-based RUL estimation algorithm using the available ESI observations at the prediction time (\(t_{PT}\)) can be summarized as the following steps:  
**Step 1: Initialization.** It is assumed that the initial state \(x_{0}\) can be taken from the first few observations of the ESI. The covariance matrix of the state process error \(\widetilde{\mathbf{P}}_{0}\) is chosen empirically, as given by  
\[\widetilde{\mathbf{x}}_{0}=\begin{pmatrix}x_{0}\\ b_{0}\end{pmatrix}=\begin{pmatrix}z_{0}\\ \ln\bigl{(}\frac{ESI(t_{PT})}{ESI(t_{PT}-1)}\bigr{)}\end{pmatrix}, \tag{30}\]  
\[\widetilde{\mathbf{P}}_{0}=\begin{pmatrix}0.1&0\\ 0&0.1\end{pmatrix}, \tag{31}\]  
where \(z_{0}\) takes the ESI at the fault detection time, \(ESI(t_{FDT})\). In this case, the covariance matrices of the state process noise and the measurement noise are scalar and set to \(\mathbf{Q}_{t}=\sigma_{w}^{2}\), \(\mathbf{R}_{t}=\sigma_{w}^{2}\).  
**Step 2: Prediction.** Obtain the noise-free a priori estimate of the state vector \(\widetilde{\mathbf{x}}_{t|t-1}\), the measurement \(\widetilde{\mathbf{z}}_{t|t-1}\) and the covariance matrix of state error \(\widetilde{\mathbf{P}}_{t|t-1}\) based on the previous time step,  
\[\widetilde{\mathbf{x}}_{t|t-1}=f\Bigl{(}\widetilde{\mathbf{x}}_{t-1|t-1},\mathbf{0}\Bigr{)}, \tag{32}\]  
\[\widetilde{\mathbf{z}}_{t|t-1}=h\Bigl{(}\widetilde{\mathbf{x}}_{t|t-1},\mathbf{0}\Bigr{)}, \tag{33}\]  
\[\widetilde{\mathbf{P}}_{t|t-1}=\mathbf{F}_{t-1}\mathbf{P}_{t-1|t-1}\mathbf{F}_{t-1}+\mathbf{G}_{t- 1}\mathbf{Q}_{t-1}\mathbf{G}_{t-1}^{T}, \tag{34}\]  
**Step 3: Update.** Compute the filter gain \(\mathbf{K}_{t}\) by  
\[\mathbf{K}_{t}=\widetilde{\mathbf{P}}_{t|t-1}\mathbf{H}_{t}^{T}\biggl{(}\mathbf{H}_{t} \widetilde{\mathbf{P}}_{t|t-1}\mathbf{H}_{t}^{T}+\mathbf{W}_{t}\mathbf{R}_{t}\mathbf{W}_{t}^{T} \biggr{)}^{-1}. \tag{35}\]  
Subsequently, take in the observations of the bearing health indicator, ESI, as the actual measurement \(\mathbf{z}_{t}\) to calculate the measurement prediction error \(\mathbf{z}_{t}-\widetilde{\mathbf{z}}_{t|t-1}\), and update the prior state estimation to attain the a posteriori state estimation \(\widetilde{\mathbf{x}}_{t|t}\),  
\[\widetilde{\mathbf{x}}_{t|t}=\widetilde{\mathbf{x}}_{t|t-1}+\mathbf{K}_{t}\Bigl{(}\mathbf{z}_ {t}-h\Bigl{(}\widetilde{\mathbf{x}}_{t|t-1},\mathbf{0}\Bigr{)}\Bigr{)}. \tag{36}\]The a posteriori estimate for the state error covariance matrix \(\widetilde{\mathbf{P}}_{t|t}\) can be updated as given by  
\[\widetilde{\mathbf{P}}_{t|t}=(\mathbf{I}-\mathbf{K}_{t}\mathbf{H}_{t})\widetilde{\mathbf{P}}_{t|t-1}. \tag{37}\]  
For steps \(t=1,\ \ldots,(t_{PT}-t_{PDT-n})\) corresponding to time stamps \(t_{PDT-m},t_{PDT-n+1},\ \ldots,t_{PT}\), the prediction step and the update step are recursively implemented until the last available observation of the ESI. \(n\) denotes the number of observations prior to \(t_{PDT}\) taken in the EKF for the stability of parameter estimation.  
**Step 4: RUL estimation.** Finally, the RUL at the prediction time \(t_{PT}\), \(rul_{t_{PT}}\), can be extrapolated based on the end-of-life (EOL) threshold, \(\overline{\gamma}\), according to the definition in Equations (7) and (8),  
\[\widetilde{rul}_{t_{PT}}=\inf\Bigl{\{}\Delta T:f\Bigl{(}\widetilde{x}_{t_{PT}+ \Delta T-1}\Bigr{)}\geq\overline{\gamma}\Bigr{\}}=\left(\ln\frac{\overline{ \gamma}}{\widetilde{\mathbf{x}}_{t_{PT}}(1)}\right)/b_{t_{PT}}. \tag{38}\]  
**Step 5: Uncertainty Estimation.** Compute the 95% credible interval (CI) of the predicted RUL based on Section 3.4.5.