# Development of Ground Special Vehicle PHM with Case-Based Reason Model
## 3 Module of Weight Optimization
### Performance Index for Objective Function  
In this application, a case library is established using the historical data record set. In order to improve the optimization effect of weights, a cross-validation method is adopted. The procedure is described as below.  
At first, select \(n\) case from case library, and divide the selected \(n\) cases into five subsets, and the subsets are marked as \(S^{1}\),\(S^{2}\),\(S^{3},\ S^{4}\) and \(S^{5}\), respectively. The total number of cases in each subset is equal. Mark one subset as the target case, and the remaining four subsets are combined to form the source case. The source case is the training set, and the target case is the test set. Following that, case retrieval and case reuse are implemented according to description in Section 2.4. Finally, the solution attribute value of each target case is obtained. Each subset in \(S=\left\{S^{1},S^{2},S^{3},S^{4},\ S^{5}\right\}\) will be taken as the target case in turn, and the remaining four subsets will form the source case base. This process repeats five times until the cross-validation is completed, the objective function is described as below.  
1. The selected case in the case library is expressed as Equations (1)-(3); for each case, there is more than one condition attribute and only one solutions attribute, and the value of the solution attribute can only be a normal state or abnormal state. The subsets from source cases are organized, as below. \[S^{i}_{j}:\left\langle X^{i}_{j},Y^{i}_{j}\right\rangle\] (10) \[X^{i}_{j}=(x^{i}_{j1},x^{i}_{j2},\ldots,x^{i}_{jm})\] (11)\[Y_{j}^{i}=y_{j1}^{i} \tag{12}\]  
In Equations (10)-(12), \(i=1,\ 2,\ 3,\ 4,\ 5.j=1,\ 2,\ \ldots,\ G.\ x_{jm}^{i}\) denotes \(j\)th case has condition attribute of \(m\) in subset \(S^{i},\ y_{j}^{i}\) denotes \(j\)th case has 1 solution attribute of \(y_{1}\) in subset \(S^{i}\). \(y_{j}^{i}\) can only be normal state or abnormal state. According to the description in Section 2.4.1, suppose the number of cases with correct state classification in the target case set is \(\ G^{c}\), and the number of target cases is \(G\), the state classification accuracy and state classification error is computed, as follows.  
\[\Delta_{i}=\frac{G^{c}}{G}\times 100\% \tag{13}\]  
\[e_{i}=1-\Delta_{i} \tag{14}\]  
where \(e_{i}\) denotes the percentage of misclassified cases in the target case set. The smaller the state classification error rate, the better the state classification accuracy. The objective function is setup by averaging the state classification error rate.  
\[F(W)=\frac{1}{5}\sum_{i=1}^{5}e_{i} \tag{15}\]
2. The selected case in the case library is expressed as Equations (1)-(3); for each case, there are more than one condition attribute and only one solutions attribute, and the value of the solution attribute is the probability value in the range of (0,1). The subsets from source cases are organized as the same in Equations (10)-(12), but the root mean square error is taken, as below.  
\[(rmse)_{i}=\left\{\frac{1}{G}\sum_{i=1}^{G}\left(y_{j}^{i}-\overline{y}_{j}^{ i}\right)^{2}\right\}^{1/2} \tag{16}\]  
In the formula, \(y_{j}^{i}\) represents the inference value of the solution attribute of the \(j\)th target case in subset \(S^{i}\), and \(\overline{y}_{j}^{i}\) represents its actual value. The smaller the RMSE, the better the result. Similarly, the objective function is setup by averaging the root mean square error.  
\[F(W)=\frac{1}{5}\sum_{i=1}^{5}(rmse)_{i} \tag{17}\]  
It can be seen from Equation (17) that the smaller the objective function, the better the attribute weight vector. Therefore, in the step of using the simulated annealing algorithm to obtain the feature attribute weight, the objective function can determine the optimized weight. If the objective function of the new solution becomes smaller, the new solution is directly accepted. Otherwise, the new solution is accepted with metropolis probability to jump out of the local optimum.