# Remaining Useful Life Prediction of Cutting Tools Using an Inverse Gaussian Process Model
## 2 Methods
### Parameter Estimation Based on Expectation-Maximization (EM)  
As the random variable parameter \(1/\mu\) cannot be observed directly, an expectation-maximum (EM) algorithm is applied to estimate its value. The EM algorithm is an iterative optimization strategy that includes an E-step and an M-step in an iteration. In each iteration, the conditional distribution of the missing data and the expectation of the complete log-likelihood, with respect to the conditional distribution of the missing data, are derived in the E-step, with the model parameters estimated in the previous step. The estimates for model parameters are then updated by maximizing the expectation of the complete log-likelihood in the M-step. The iteration is repeated until the estimates for model parameters converge. Since we have assumed that \(1/\mu~{}\sim~{}\mathrm{N}\Big{(}\pi_{\mu},\sigma_{\mu}^{-2}\Big{)}\), according to the Bayesian formula, the posterior distribution of \(1/\mu_{k}\) at \(t_{k}\) can be obtained according to the Bayesian formula:  
\[\mathrm{P}\bigg{(}\frac{1}{\mu_{k}}|\mathbf{Y}_{0:k}\bigg{)}\propto\mathrm{P} \bigg{(}\mathbf{Y}_{0:k}\bigg{|}\frac{1}{\mu_{k}}\bigg{)}\mathrm{P}\bigg{(} \frac{1}{\mu_{k}}\bigg{)}\propto\prod_{i=1}^{k}\exp\left[-\frac{\lambda_{k}( \Delta y_{i}-\mu_{k}\Delta\Lambda(t_{i}))^{2}}{2\mu_{k}\Delta y_{i}}\right] \exp\left[-\frac{\sigma_{\mu,k^{2}}\Big{(}1-\mu_{k}\alpha_{\mu,k}\Big{)}^{2}} {2\mu_{k}{}^{2}}\right]\]  
\[=\exp\left\{-\frac{\lambda_{k}}{2\mu_{k}^{2}}\sum_{i=1}^{k}\frac{(\Delta y_{i} -\mu_{k}\Delta\Lambda(t_{i}))^{2}}{\Delta y_{i}}-\frac{\sigma_{\mu,k^{2}} \Big{(}1-\mu_{k}\alpha_{\mu,k}\Big{)}^{2}}{2\mu_{k}{}^{2}}\right\}\]  
\[\propto\exp\left[-\frac{\lambda_{k}y_{k}+\sigma_{\mu,k^{2}}}{2}\left(\frac{1}{ \mu_{k}{}^{2}}-2\frac{\lambda_{k}\Lambda(t_{k})+\alpha_{\mu,k}\sigma_{\mu,k^{ 2}}}{\mu_{k}\Big{(}\lambda_{k}y_{k}+\sigma_{\mu,k^{2}}\Big{)}}\right)\right] \sim\mathrm{N}\Big{(}\alpha_{0,k},\sigma_{0,k}{}^{-2}\Big{)}, \tag{15}\]  
where  
\[\alpha_{0,k}=\frac{\lambda_{k}\Lambda(t_{k})+\alpha_{\mu,k}\sigma_{\mu,k} {}^{2}}{\lambda_{k}y_{k}+\sigma_{\mu,k}{}^{2}}, \tag{16}\]  
\[\sigma_{0,k}{}^{2}=\lambda_{k}y_{k}+\sigma_{\mu,k}{}^{2}, \tag{17}\]  
Define \(\theta_{k}^{j}=\Big{(}\alpha_{u,k^{\prime}}^{j}\sigma_{u,k}{}^{2(j)},\lambda_{ u,k}^{j}\Big{)}\) as the parameter \(\theta\) at time \(t_{k}\), where \(j\) is iteration times. The complete log-likelihood function of \(\{\mathbf{Y}_{0:k},\frac{1}{\mu}\}\) can be expressed as follows:  
\[\mathrm{L}\bigg{(}\theta|\mathbf{Y}_{0:k}\frac{1}{\mu}\bigg{)}=\ln\left[ \mathrm{P}\bigg{(}\mathbf{Y}_{0:k},\frac{1}{\mu}\left|\theta\right.\bigg{)} \right]=\ln\left[\mathrm{P}\bigg{(}\mathbf{Y}_{0:k}\bigg{|}\frac{1}{\mu}, \theta\bigg{)}\,\mathrm{P}\bigg{(}\frac{1}{\mu}\left|\theta\right.\bigg{)}\right]\]  
\[=\frac{k}{2}\ln(\lambda)-\frac{k+1}{2}\ln 2\pi+\sum_{i=1}^{k}\ln(\Delta \Lambda\left(t_{i}\right))-\frac{3}{2}\sum_{i=1}^{k}\ln(\Delta y_{i})+\frac{1} {2}\ln(\sigma_{\mu}^{2})\]  
\[-\sum_{i}^{k}\frac{\lambda(\Delta y_{i}-\mu\Delta\Lambda(t_{i}))^{2}}{2\mu^{2} \Delta y_{i}}-\frac{\sigma_{\mu}^{2}}{2}\bigg{(}\frac{1}{\mu}-\alpha_{\mu} \bigg{)}^{2}, \tag{18}\]  
By maximizing the complete log-likelihood function, the parameter \(\theta\) is calculated as follows:  
\[\alpha_{\mu,k}^{j+1}=\mathrm{E}\bigg{(}\frac{1}{\mu}\bigg{)}, \tag{19}\]  
\[\alpha_{\mu,k}^{2(j+1)}=\mathrm{D}\bigg{(}\frac{1}{\mu}\bigg{)}^{-1}, \tag{20}\]  
\[=\exp\left\{-\frac{\lambda_{k}}{2\mu_{k}^{2}}\sum_{i=1}^{k}\frac{(\Delta y_{i} -\mu_{k}\Delta\Lambda(t_{i}))^{2}}{\Delta y_{i}}-\frac{\sigma_{\mu,k^{2}} \Big{(}1-\mu_{k}\alpha_{\mu,k}\Big{)}^{2}}{2\mu_{k}{}^{2}}\right\}\]0  
where \(\mathrm{E}\Big{(}\frac{1}{\mu}\Big{)}\) and \(\mathrm{D}\Big{(}\frac{1}{\mu}\Big{)}^{-1}\) are the expectation and variance of \(\frac{1}{\mu}\) conditional on \(\mathbf{Y}_{0:k}\) given in (16) and (17). The optimal parameters \(\theta_{k}=\theta_{k}{}^{j+1}\) can be obtained by the iteration untilalgorithm convergence.