# Online State of Health Estimation for Lithium-Ion Batteries Based on Support Vector Machine
## 3 State of Health Estimation Model
### Optimal Support Vector Machine Parameter Determination  
There are two key steps needed to properly build the SVM model: determination of the kernel function and selection of its parameters. The main function of the kernel function is to implement the nonlinear mapping from the original input space to a high dimension space. By comparison, the RBF is employed in this paper as the kernel function and can be formulated as  
\[K(x_{i},x_{i})=e^{(-g\|x_{i}-x_{j}\|^{2})}=e^{-\frac{\|x_{i}-x_{j}\|^{2}}{2\sigma ^{2}}}, \tag{6}\]  
where \(g=1/2\sigma^{2}\) and denotes width of the RBF. \(C\) and \(g\) need to be optimized which are crucial to improve the estimation precision of the SVM algorithm. Variety of approaches can be applied to optimize them. Among all the manners, the grid search algorithm is an exhaustive searching algorithm, which needs to be guided by some performance metric and typically measured by the cross-validation (CV) on the training set [32]. Among all the CV methods, the k-fold CV (k-CV) is the most popular CV candidate, and thus we select it to train the RVM model. More concretely, \(C\) and \(g\) are ensured within a certain range and the minimal square error (MSE) is employed to evaluate the selection for different \(C\) and \(g\) based on the k-CV calculation,  
\[MSE=\frac{1}{l}\sum_{i=1}^{l}(f(x_{i})-y_{i})^{2}, \tag{7}\]  
where \(f(x_{i})\) is the estimated SOH, \(y_{i}\) is the actual value, and \(l\) is the number of testing samples. Then, we modify the range of grid search based on the results of the previous step and repeat the previous step  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Vector** & **SOH** & \(t\) & \(A_{h}\) & \(E_{s}\) \\ \hline Unscaled & 92.82\% & 3027 & 1.2687 & 48777 \\ Scaled & 1 & 0.7808 & 0.7780 & 0.7932 \\ \hline \hline \end{tabular}  
* SOM: state of health.  
\end{table}
Table 2: An example of feature vectors.  
Figure 4: Feature parameters computed for Cell 2 under different voltage region. (**a**) The vector of \(t\) under different voltage region; (**b**) The vector of \(E_{a}\) under different voltage region; (**c**) The vectors of \(A_{h}\) under different voltage region.  
until a suitable (\(C\), \(g\)) is found with target of minimizing the MSE. The purpose of the SVM model established in this paper is not to memorize input training sets, but to estimate the unknown input samples precisely. Hence, evaluation of generalization error is extremely important. To sum up, the employed CV algorithm is capable of avoiding the occurrence of over-fitting with the acceptable computational labor and consequently can reduce the generalization error.  
For comprehensively evaluating the predictive performance, a combination of evaluation metrics is commonly employed [26; 33]. Here, MSE and the mean absolute relative error (MARE) are referred together to evaluate the performance of the proposed method from different aspects, as show in (7) and (8).  
\[MARE=\frac{1}{l}\sum_{i=1}^{l}\frac{\left|f(x_{i})-y_{i}\right|}{y_{i}}\times 1 00\%. \tag{8}\]  
By giving relatively higher weighting to large errors, MSE is an appropriate index for avoiding larger deviations but cannot reflect the central tendency (average error) of the model. Mean absolute relative error is a natural tool for assessing average relative error of model, which can compensate for the shortcoming of MSE. Benefiting from these indexes, the predictive errors can be observed for deeper analysis. It is necessary to mention that the proposed method with regard to the SVM is realized based on LIBSVM toolbox under MATLAB/Simulink 2016a, which is developed by MathWorks with headquarters in Natick, Massachusetts, U.S.A [34]. The result validations are presented in the next section with detailed analysis.