## 3 Adaptive Thresholds for Robust Fault Detection
### Residual Evaluation
#### 3.3.2 An Equilibrium Point
The detectability, denoted as D, of the system means that how much the detection performance depends on the size of the normal region defined by the normality model. As mentioned above, higher adaptability results in the large size of the normal region so that it induces an increase in the false negative error rate. The level of the detectability is defined as a weighted harmonic mean of recall and precision, called \(F_{\beta}\)-score. Precision provides the information on how accurately our model predicts the given residual as an actual fault. Recall provides the information on how accurately our model captures faults which should be an actual fault. To have a balance between the two, \(F_{1}\)-score is commonly used as a measure of an accuracy in binary classification. In our work, we give the recall more weight than precision because, in safety-critical applications, the false negative errors are worse and more dangerous than false positive errors in general. \(F_{2}\)-score bounds from 0 to 1 from Equation (3). \[D(\rho_{r},\sigma_{u})\equiv F_{2}\text{score}=\left(1+2^{2}\right)\times \frac{Precision\times recall}{\left(2^{2}\times Precision\right)+recall} \tag{3}\]  
For the sake of the simplicity in calculation, we exploit the number of offsets to calculate the reference point rather than using the value of the reference point directly. Note that the number of offsets starts from one and the maximum number of offsets is different for each velocity of Jackal UGV. Given the data set of the uncertainty of \(m\) units, the uncertainty function \(U(x)\) is with the negative slope by using the uncertainty level \(U(\rho_{r},\sigma_{u})\) as a function of the number of offsets. Hence we define the function of the uncertainty representing the sensitivity as the following form:  
\[U(x)=-ux+a,u>0, \tag{4}\]  
where \(x\) is the number of offsets corresponding to reference point as the explanatory variable, and the constant variables \(u\) and \(a\), are given by using linear regression analysis. We also use a linear regression analysis to find the relationship between detectability and the number of the offsets. Given the data set of the detectability of \(m\) units, since the number of offsets to the reference point has a positive relationship to the detectability levels \(D(\rho_{r},\sigma_{u})\) representing the adaptability, the relationship is defined as follows:  
\[D(x)=px+c,p>0, \tag{5}\]  
where the constant variables \(p\) and \(c\), are also given by using linear regression analysis. Our approach is to determine the point is that as the reference point increases, the sum of the expected amount of the adaptability and the expected amount of the sensitivity that is obtained is maximized. By nonlinear programming, a two-variable constrained optimization problem can then be written as:  
\[ \begin{array}{ll}\textit{maximize}&S(x)=\int\limits_{x_{1}}^{x_{m}}D^{t}(x) dx+\int\limits_{x_{2}}^{x_{m}}U(x)dx,\\ &\textit{subject to }x_{1}=x_{2}\end{array}  \tag{6}\]  
where \(D^{t}\) is to perform transformation of the function\(D(x)\) through composition transformation to reflect the effect of the maximum number of offsets depending on the velocity, and described by  
\[D^{t}(x)=-p(x-x_{m})+c. \tag{7}\]  
This transformation does not change the solution of the original problem and consists of the reflection about \(Y\)-axis and translation with the offset vector (\(x_{m}\), 0), where \(x_{m}\) is the maximum value of \(X\)-axis. The method of the Lagrange multiplier that is applied to find a point \(x^{*}\) at which the function \(S(x)\) values are maximized:  
\[L(x_{1},x_{2},\ \lambda)=S(x)+\lambda(x_{1}-x_{2}), \tag{8}\]  
where \(\lambda\) is the Lagrange multiplier. The variable \(x^{*}\) to be optimal (a global max) which fully meets the necessary condition for the Lagrange function is obtained as Equation (9). \[x^{*}=\frac{a+c+px_{m}}{u+p} \tag{9}\]  
Note that a conversion to reference point is required since the determined \(x^{*}\) indicates the number of offsets.