## 2 AAKR-Based Method for Fault Detection  
AAKR is a lazy learning method that uses training data stored in memory to calculate the similarity of query vectors and then assigns higher weights to the training data with the highest similarity. In contrast to eager learning algorithms, such as artificial neural networks (ANNs), support vector machines (SVMs), and group method of data handling, AAKR can compute predictions by building different local models based on query vectors that are input in real-time.  
Owing to these advantages, AAKR can also be applied to complex processes such as time-varying processes and multimodal processes. The fault detection procedure using AAKR is shown in Figure 2.  
AAKR uses training data stored in memory. The training data consist of process data under normal operation. They are used to calculate the similarity of query vectors input in real-time. Several types of distance functions are available, including Euclidean, Mahalanobis, and Chebychev. Equation (1), for calculating the distance, is presented as follows.  
\[d_{i}(\mathbf{x}_{\text{trm}},\mathbf{x}_{\text{query}})=\sqrt{(x_{\text{trm }}^{1}-x_{query}^{1})+(x_{\text{trm}}^{2}-x_{query}^{2})+,\ldots,+(x_{\text{trm }}^{m}-x_{\text{qilergy}}^{m})}^{2}, \tag{1}\]  
where \(d_{i}\) is the distance between the \(i\)-th training data (\(\mathbf{x}_{\text{trm}}\)) and query vector (\(\mathbf{x}_{\text{query}}\)). The smaller the distance, the more similar the training data. For example, a large \(d_{i}\) indicates a low similarity. The similarity obtained from the distance function is used to assign weights, as shown in Equation (2) [34]. Common weighting functions include Gaussian, exponential, and uniform. If the query vector is far from the training data, a low weight is assigned.  
\[K_{h}(d_{i})=\frac{1}{\sqrt{2\pi}h}\text{exp}\left[-\frac{d_{i}^{2}}{2h^{2}} \right],\ i=1,\ldots,n, \tag{2}\]  
where \(h\) is the bandwidth parameter that controls the width of the weighting function. When \(h\) is large, a high weight is assigned to numerous training data, which can reduce the accuracy of fault detection. Therefore, the performance of AAKR depends on \(h\), making it critical to determine an appropriate value. In this study, \(h\) was optimized by minimizing the error using k-fold cross validation, a widely used technique. Using the similarities  
Figure 2: Fault detection procedure using AAKR.  
and weights obtained from Equations (1) and (2), the estimated vector of query vectors is derived from Equation (3).  
\[\hat{\mathbf{x}}_{\text{query}}=\frac{\sum_{i=1}^{n}K_{h}(d_{i})\cdot\mathbf{x} _{\text{tmp}}^{i}}{\sum_{i=1}^{n}K_{h}(d_{i})},\ j=1,\ldots,n, \tag{3}\]  
where \(\hat{\mathbf{x}}_{\text{query}}\) indicates the query vector and the corresponding estimated vector derived from the training data. The estimated vector refers to the difference between the actual measured value and the value predicted by AAKR, which is defined as the residual error. A smaller residual error indicates that the query vector closely matches the training data, allowing it to be classified as normal. Finally, the residual vector is obtained using Equation (4). In this paper, leave-one-out cross validation, which is a specific form of k-fold cross validation, is employed to generate residuals from the training data.  
\[\mathbf{e}_{\text{query}}=\mathbf{x}_{\text{query}}-\hat{\mathbf{x}}_{\text{ query}}, \tag{4}\]  
where \(\mathbf{e}_{\text{query}}\) is the residual vector calculated as the difference between the query vector and the estimated vector. It is used in the squared prediction error (SPE), which serves as a detection index for fault detection.