# Fault Detection Algorithm Based on Dynamic Global-Local Preserving Projection
## 3 Fault Detection Based on DGLPP
### DGLPP Algorithm  
After establishing the augmented matrix to obtain the dynamic information of the system, the GLPP method is used to reduce the dimension of the data and the DGLPP model is established for fault detection. The idea of GLPP involves combining the local structure preserving objective function and the global variance maximum objective function to construct the local and global preserving objective function. As a result, the dimensionality-reduced data retain the global structure and local nearest neighbor structure of their original feature space. In particular, the original high-dimensional dataset \(X\) is mapped to the low-dimensional space by transforming matrix \(A\) to obtain the reduced-dimension dataset \(Y\) and ensure that the generated dataset \(Y\) can fully retain the global and local structures of the original dataset \(X\). The objective function for constructing GLPP is shown as follows:  
\[\min_{a}\{J_{Lobal}(a),J_{Clocal}(a)\} \tag{6}\]  
where \(a\) is the transformation vector. Moreover, the subfunction \(J_{Local}(a)=\frac{1}{2}\sum_{ij}{(y_{i}-y_{j})^{2}W_{ij}}\) stores the local structure of the data, and the subfunction \(J_{Clocal}(a)=-\frac{1}{2}\sum_{ij}{(y_{i}-y_{j})^{2}\overset{\Lambda}{W_{ij}}}\) stores the global structure of the data. \(W_{ij}\) is the adjacency weight matrix, representing the adjacency of \(x_{i}\) and \(x_{j}\). Any pair of adjacent points \(x_{i}\) and \(x_{j}\) in space has a corresponding nonzero \(W_{ij}\). The calculation formula of \(W_{ij}\) is shown as follows:  
\[W_{ij}= \begin{cases}e^{-\frac{\|x_{i}-y_{j}\|}{\sigma}}&if\ x_{j}\in\Omega_{k }(x_{i})\ or\ x_{i}\in\Omega_{k}(x_{j})\\ 0&otherwise\end{cases}  \tag{7}\]  
where \(\sigma\) is the empirical constant and \(\Omega_{k}(x_{i})\) is the first \(k\)-nearest neighbor set of the \(x_{i}\) sample. Unlike \(W_{ij}\), \(\overset{\Lambda}{W_{ij}}\) is a non-neighborhood weight matrix. \(\overset{\Lambda}{W_{ij}}\) represents the non-neighborhood of \(x_{i}\) and \(x_{j}\). Any pair of non-neighboring points \(x_{i}\) and \(x_{j}\) in space has a corresponding nonzero \(\overset{\Lambda}{W_{ij}}\). The formula for \(\overset{\Lambda}{W_{ij}}\) is as follows:  
\[\overset{\Lambda}{W_{ij}}= \begin{cases}e^{-\frac{\|x_{i}-x_{j}\|}{\sigma}}& if\ x_{j}\
otin\Omega_{k}(x_{i})\ and\ x_{i}\
otin\Omega_{k}(x_{j})\\ 0&otherwise\end{cases}  \tag{8}\]  
The subobjective function \(J_{Local}(a)=\frac{1}{2}\sum_{ij}{(y_{i}-y_{j})^{2}W_{ij}}\) is further transformed into the following:\[ \begin{array}{ll}I_{Local}(a)&=\frac{1}{2}{\sum\limits_{ij}}\left(y_{i}-y_{j} \right)^{2}W_{ij}\\ &=\sum\limits_{ij}y_{i}D_{ii}y_{i}^{\top}-\sum\limits_{ij}y_{i}W_{ij}y_{j}^{ \top}\\ &=\sum\limits_{ij}a^{\top}x_{i}D_{ii}x_{i}^{\top}a-\sum\limits_{ij}a^{\top}x_{ i}W_{ij}x_{j}^{\top}a\\ &=a^{T}X(D-W)X^{T}a\\ &=a^{T}XLX^{T}a\end{array}  \tag{9}\]  
where \(L=D-W\) is the Laplace matrix, \(D\) is the diagonal matrix, and the diagonal element \(D_{ii}=\sum_{j}W_{ij}\) is the sum of the elements of the corresponding rows or columns of the nearest neighbor weight matrix \(W\). Similarly, the subobjective function \(J_{Global}(a)=-\frac{1}{2}{\sum\limits_{ij}}\left(y_{i}-y_{j}\right)^{2}\hat{W }_{ij}\) can be rewritten as follows:  
\[ \begin{array}{ll}J_{Global}(a)&=-\frac{1}{2}{\sum\limits_{ij}} \left(y_{i}-y_{j}\right)^{2}\hat{W}_{ij}\\ &=-\sum\limits_{ij}y_{i}\hat{D}_{ii}y_{i}^{\top}-\sum\limits_{ij}y_{i}\hat{W }_{ij}y_{j}^{\top}\\ &=-\sum\limits_{ij}a^{T}x_{i}\hat{D}_{ii}x_{i}^{\top}a-\sum\limits_{ij}a^{T}x _{i}\hat{W}_{ij}x_{j}^{\top}a\\ &=-a^{T}X(\hat{D}-\hat{W})X^{T}a\\ &=-a^{T}XLX^{T}a\end{array}  \tag{10}\]  
where \(\hat{L}=\hat{D}-\hat{W}\) is the Laplace matrix, \(\hat{D}\) is the diagonal matrix, and \(\hat{D}_{ii}=\sum_{j}\hat{W}_{ij}\). GLPP introduces a weighting coefficient \(\eta\) to optimize the global and local features' subobjective functions simultaneously. The bio-objective optimization can be transformed into the following single-objective optimization problem by using this weighting coefficient:  
\[