## 3 Online Root Fault Identification Method
### Online Root Fault Diagnosis
#### 3.2.1 Weighted Distance Calculation  
1. Distance measure  
This similarity is typically measured by computing certain metrics. When compared with thresholds, the resulting score determines if one alarm vector belongs to a root fault. Choosing a suitable distance measure increases the overall performance of the online diagnosis. An online unknown alarm vector \(V^{\prime}\) is expressed as:  
\[V^{\prime}=[{v^{\prime}}_{1},{v^{\prime}}_{2},\ldots{v^{\prime}}_{i},\ldots,{ v^{\prime}}_{N}]^{\overline{1}}. \tag{19}\]  
where \({v^{\prime}}_{i}\) is the binary value of alarm \(i\). The distance between the alarm vector and the feature vector of fault \(k\) is expressed as:  
\[D(V^{\prime},C_{k}), \tag{20}\]  
where \(C_{k}\) is the feature vector of fault \(k\) and \(k=1,2,\ldots,P\).  
The Euclidean distance [23] and the Hamming distance [24] are often used as metrics. The Euclidean distance between the unknown alarm vector and the feature vector of fault \(k\) is calculated as:  
\[D_{E}(V^{\prime},C_{k})=\sqrt{\sum_{i=1}^{N}{({v^{\prime}}_{i}-c_{ki})^{2}}}. \tag{21}\]  
where \({v^{\prime}}_{i}\) is the binary value of alarm \(I\) and \(c_{ki}\) is the binary value of alarm \(i\) in the alarm vector of fault \(k\). The Hamming distance is defined to be the number of positions where they differ. The Hamming distance between an unknown alarm vector and the feature vector of fault \(k\) is calculated as:  
\[D_{H}(V^{\prime},C_{k})=\frac{\sum\limits_{i=1}^{N}{|{v^{\prime}}_{i}-c_{ki}|} }{N}. \tag{22}\]where \(v^{\prime}_{i}\) is the binary value of alarm \(I\) and \(c_{ki}\) is the binary value of alarm \(i\) in the alarm vector of fault \(k\). We used both distances to measure the similarity. The performance of the distances is compared and analyzed in the next sections.  
2. Weighted distance  
The above similarity measures treat alarms in feature vectors equally without any identification. The coupling correspondence between alarms and faults is not considered. We define a weighted distance based on the weights of alarms to measure the similarity. A weight vector is associated with each alarm. The weight vector is expressed as:  
\[W_{k}=[w_{k1},w_{k2},\ldots,w_{ki},\ldots w_{kN}], \tag{23}\]  
where \(w_{ki}\) is the weight assigned to alarm \(i\) in fault \(k\).  
The weighted distance is expressed as \(D_{W}(V^{\prime},C_{k})\), where \(k=1,2,\ldots,P\). The weighted Euclidean distance is defined as follows:  
\[D_{WE}(V^{\prime},C_{k})=\sqrt{\sum\limits_{i=1}^{N}w_{ki}(v^{\prime}_{i}-c_{ ki})^{2}}, \tag{24}\]  
where \(w_{ki}\) is the weight assigned to alarm \(i\) in fault \(k\); \(v^{\prime}_{i}\) is the binary value of alarm \(ic_{ki}\) is the binary value of alarm \(i\) in the alarm vector of fault \(k\).  
The weighted Hamming distance is defined as follows:  
\[D_{WH}(V^{\prime},C_{k})=\frac{\sum\limits_{i=1}^{N}w_{ki}|(v^{\prime}_{i}-c_{ ki})|}{\sum\limits_{i=1}^{N}w_{ki}}. \tag{25}\]  
where \(w_{ki}\) is the weight assigned to alarm \(i\) in fault \(k\); \(v^{\prime}_{i}\) is the binary value of alarm \(i\); \(c_{ki}\) is the binary value of alarm \(i\) in the alarm vector of fault \(k\).