## 4 Methodology
### CF Model Calibration and Validation Based on Driving Modes
#### 4.2.2 CF Calibration  
The evaluation of the calibration results is crucial for determining the capability of a CF model to accurately replicate real-world driving behavior, minimizing discrepancies between simulated data and actual observations within the parameter space being searched. The validation process is usually responsible for the effectiveness of model parameter calibration and parameter generalization, for example, testing how whether a set of parameters can fit well the other CF events of a certain driver.  
K-fold cross-validation is a commonly used model evaluation method. It divides the dataset into five parts and uses four of them as training data and the remaining one as test data each time. We adopted five-fold cross validation in this study, which allows for five rounds of training and testing, with the average value taken as the performance evaluation of the model, as shown in Figure 5. This method can effectively avoid overfitting and better evaluate the model's performance on unknown data. For each driver involved in the calibration, 80 of the 100 events were for calibration and the other 20 events were for validation, iterating in turn. The average error on the validation data was used to compare the performance of the investigated models.  
To ensure the accuracy of comparison results in the calibration process, we followed a specific protocol. First, our objective function was defined as the deviation between simulated and observed spacing measures [47; 48], which has been demonstrated to be a reliable metric in previous studies [49; 50]. Following an in-depth analysis of the objective function presented in [51], we employed the root mean square normalized error (RMSNE) as a measure of the relative error. This has been shown to be effective in previous studies [48; 52], defined as:  
\[\text{RMSNE of spacing}=\sqrt{\frac{1}{N}\sum_{i}^{N}\Biggl{(}\frac{S_{i}^{ \text{obs}}-S_{i}^{\text{sim}}}{S_{i}^{\text{obs}}}\Biggr{)}^{2}} \tag{5}\]  
where \(S_{i}^{\text{obs}}\) and \(S_{i}^{\text{sim}}\) are the \(i\)th observed spacing and simulated spacing, respectively, with \(i\) ranging from 1 to \(N\).  
To address the constrained nonlinear optimization problem in the calibration process, a genetic algorithm (GA) was employed in our empirical experiments. The effectiveness of GA was previously validated in the literature [1; 9]. To ensure fast convergence and realistic kinematics, we set the bounds and initial searching values of the CF model parameters based on the values reported in previous studies [21; 24; 49]. Table 1 summarizes these values. During the calibration of the DBM, a set of parameters achieving global optimization on the error of reproducing the driver's CF events set is assigned to each driver. Similarly, during the calibration of the DMBM, each mode is assigned a set of parameters. The  
Figure 5: Illustration of the five-fold cross-validation.  
obtaining of the results of the DMBM involves a two-step calibration process. First, TICC was used to obtain the driving-mode labels of each time step (the labels were generated for each candidate value of the number of undetermined K). Then, in the calibration process, the objective function (which simulates CF trajectories and calculates calibration errors) dynamically chooses different sets of parameters based on the driving mode labels, as shown in Figure 6. After calibration, the optimal parameters can be solved.  
In an effort to attain the global optimum, we conducted the optimization procedure ten times for each car-following event. The set of parameters that yielded the lowest RMSNE was recorded. Since the optimization process requires a large population size in GA, while the searching spacing of the parameters of the hybrid model or the DMBM model is much larger than the IDM, we utilized a high-performance server to solve the calibration in parallel. Its CPU is AMD EPYC 7H12 with 64 cores and 128 threads.