## 2 Materials and Methods
### Parameter Selection for Effective Filtering of Similar Test Runs  
To filter out overly similar test runs, we subjected the original test run database to further processing. In this case, we also utilized vector formation. First, we selected the 10 key parameters that could cause minor or major variations in most runs. Then, using the appropriate Microsoft Excel(r) functions, we created a 11-dimensional vector (**p**) based on these parameters. In this instance, we did not only create binary vectors (0-1) but also used various values, ensuring that these values preferably fall within the range of \(-1\) to 1. Thisapproach prevents certain parameters (e.g., speed, which can be as high as 130 km/h) from having too much influence on the comparison, thereby distorting the results. The selected parameters are as follows:  
* VUT speed [km/h];
* VUT direction;
* Target speed [km/h];
* Target movement;
* Target direction;
* Overlap;
* Obstruction;
* Lighting condition;
* Line type;
* Road type;
* Target type.  
The processing methods used to assign numerical values to the parameters are detailed in Table A1 of Appendix A.  
After selecting the relevant cases using WCS as described in Section 2.3, we calculated the cosine similarity (CS) from an 11-dimension vector containing only '1' values (**u**) for test run parameters that produced identical values (CS\({}_{\text{Rj}}\)) using the following formula:  
\[\text{CS}_{\text{Rj}}=\frac{\sum_{i=1}^{n}\mathbf{u}_{i}\cdot\mathbf{p}_{\text {j},i}}{\sqrt{\sum_{i=1}^{n}\mathbf{u}_{i}^{2}}\cdot\sqrt{\sum_{i=1}^{n}\mathbf{ p}_{\text{j},i}^{2}}} \tag{2}\]  
In Formula (2), \(\mathbf{p}_{\text{j}}\) is the vector of the processed the run; j is the No. of the test run.  
We sorted the calculated values from largest to smallest and then utilized two fundamental vector norms to measure distances: the \(\ell^{1}\) norm, also known as the Manhattan Distance (MD), and the \(\ell^{2}\) norm, known as the Euclidean Distance (ED). The MD calculates the distance between two points by summing the absolute differences of their coordinates [32]. Mathematically, in our case, for two neighboring processed test run vectors (\(\mathbf{p}_{\text{j}}\) and \(\mathbf{p}_{\text{j+1}}\)), the MD is calculated as follows using Formula (3):  
\[\text{MD}_{\text{j},\text{j+1}}=\sum_{i=1}^{n}\left|\mathbf{p}_{\text{j},i}- \mathbf{p}_{\text{j+1},i}\right| \tag{3}\]  
The ED measures the straight-line distance between two points in Euclidean space. It is computed as the square root of the sum of the squared differences between corresponding coordinates of the vectors [32]. The ED is calculated for the same \(\mathbf{p}_{\text{j}}\) and \(\mathbf{p}_{\text{j+1}}\) vectors with Formula (4):  
\[\text{ED}_{\text{j},\text{j+1}}=\sqrt{\sum_{i=1}^{n}\left(\mathbf{p}_{\text{ j},i}-\mathbf{p}_{\text{j+1},i}\right)^{2}} \tag{4}\]  
Test runs with values below a certain threshold were considered too similar, and thus one or more of them were removed from the final test run collection. The threshold can be defined case by case. Based on our experiences, the threshold could be set between 0.1 and 2, depending on the purpose of the filtering, but 1 could be an ideal choice. In this case, an adaptive thresholding approach also can be used, introduced in case of WCS in the previous section (Section 2.3).  
Based on our analysis during the testing of the methodology, we concluded that only scenarios that are highly similar to one another were filtered out, while those that differ more substantially remained in the dataset. Among the highly similar scenarios, it may be advisable to ensure that the most critical or hazardous one is retained. This selection could, for example, be based on the vehicle's speed or the target object's speed.  
In the following section, we present an example calculation introducing the process of test scenario selection and also presenting the differences and advantages when using the MD or ED for selection using different thresholds.