# Research on Prediction Method of Hydraulic Pump Remaining Useful Life Based on KPCA and JITL
## 3 Principle of JITL Method
Therefore, the following is set:  
\[D(\mathbf{x}_{i},\mathbf{x}_{q})=w_{q}, \tag{21}\]  
that is,  
\[\min\sum_{(\mathbf{x}_{i},y_{i})\in\mathbf{\Omega}_{k}}\left[y_{i}-f(\mathbf{x}_{i},\mathbf{ \theta})\right]^{2}D(\mathbf{x}_{i},\mathbf{x}_{q}). \tag{22}\]  
It is considered that in the neighborhood of the input vector, \(\mathbf{x}_{q}\), the local model of the system can be represented by a linear polynomial. First, it is necessary to provide the range size of the neighborhood, \(k\), of the current input vector, \(\mathbf{x}_{q}\); \([k_{m},k_{M}]\) indicates that the number of vectors required for the local modeling of the current input vector, \(\mathbf{x}_{q}\), is at least \(k_{m}\) and at most \(k_{M}\). \(D(\mathbf{x}_{i},\mathbf{x}_{q})\) is taken as a criterion for selecting samples, and the current input vector, \(\mathbf{x}_{q}\), is used to construct their neighborhood, \(\mathbf{\Omega}_{k}\). Because a large \(D(\mathbf{x}_{i},\mathbf{x}_{q})\) implies high similarity degree between the vectors, the descending order arrangement method is adopted to construct the neighborhood as follows:  
\[\mathbf{\Omega}_{k}=\{(\mathbf{x}_{1},y_{1}),(\mathbf{x}_{2},y_{2}),\ldots,(\mathbf{x}_{k},y_ {k})|D_{1}>D_{2}>\ldots>D_{k}\}. \tag{23}\]  
Therefore, the problem of solving Equation (18) is transformed into an optimal selection problem of neighborhood \(k\). To improve the prediction speed of the system, the recursive least square algorithm [46] is used to calculate parameter \(\mathbf{\hat{\theta}}_{k}\) of the sub-models. \[\left\{ \begin{array}{c}\mathbf{V}_{k}=\mathbf{V}_{k-1}-\frac{\mathbf{V}_{k-1}\mathbf{\Omega} (\mathbf{x}_{k},\mathbf{x}_{q})(\mathbf{x}_{k})^{T}\mathbf{V}_{k-1}}{1+D(\mathbf{x}_{k},\mathbf{x}_{q}) (\mathbf{x}_{k})^{T}\mathbf{V}_{k-1}\mathbf{x}_{k}}\\ r_{k}=\mathbf{V}_{k}\mathbf{x}_{D}(\mathbf{x}_{k},\mathbf{x}_{q})\\ e_{k}=y_{k}-(\mathbf{x}_{k})^{T}\mathbf{\hat{\theta}}_{k-1}\\ \mathbf{\hat{\theta}}_{k}=\mathbf{\hat{\theta}}_{k-1}+\tau_{k}\epsilon_{k}\end{array}  \right., \tag{24}\]  
where \(k\in\{1,2,3,\ldots,k\}\), \(\mathbf{V}_{k}\) is a diagonal matrix, \(e_{k}\) is the error between the predicted value and the actual value of the \(k\)-th historical data during the establishment of the sub-model, and \(r_{k}\) is the pre-set error correction coefficient. To examine the advantages and disadvantages of the model over time, the cross-validation calculation method is selected to calculate the \"leave-one-out error\" [47] of the model. Specifically, first, one sample is removed from all the samples, subsequently the remaining samples are used for modeling, and finally, the removed sample is used to check the current model. Based on the local model, \(\mathbf{\hat{\theta}}_{k}\), and the matrix, \(V_{k}\), the \"leave-one-out error\" value [48] of the current model is obtained as follows:  
\[e_{j}^{loo}=\frac{y_{i}-\mathbf{x}_{j}^{T}\mathbf{\hat{\theta}}_{k}}{1-\mathbf{x}_{j}^{T} \mathbf{V}_{k}\mathbf{x}_{j}D(\mathbf{x}_{j},\mathbf{x}_{q})},j=1,2,\ldots,k. \tag{25}\]  
Because there are a total of \(k\) samples in the model, there are \(k\) values of the \"leave-one-out error\" as follows:  
\[e^{loo}=\left\{e_{j}^{loo}\right\}_{j=1}^{k},k\in[k_{m},k_{M}]. \tag{26}\]  
Using the mathematical calculation method of mean square error, the following is obtained:  
\[MSE^{loo}(k)=\frac{\sum_{j=1}^{k}D(\mathbf{x}_{j},\mathbf{x}_{q})(e_{j}^{loo})^{2}}{ \sum_{j=1}^{k}D(\mathbf{x}_{j},\mathbf{x}_{q})}. \tag{27}\]Thus, the range size of the optimal neighborhood, \(k\), can be obtained using the following formula:  
\[k^{opt}=\operatorname*{argmin}_{k\in[k_{m}=k_{M}]}\Bigl{[}MSE^{loo}(k)\Bigr{]}. \tag{28}\]  
In this case, \(\hat{\mathbf{\theta}}\) is the optimal model of the system in the neighborhood of \(\mathbf{x}_{q}\). When constructing the neighborhood of the input vector, \(\mathbf{x}_{q}\), we can follow the standard formula in Equation (20), that is, the sample constructed in the neighborhood is sorted in descending order based on the magnitude of the similarity coefficient.