# Transit Traffic Filtration Algorithm from Cleaned Matched License Plate Data
## 3 Materials and Methods
### Transit Traffic Filtration Algorithm  
Given the shortcomings of existing travel time estimation methods and their symmetrical effect on outlier detection, a new algorithm (see Algorithm 1) is proposed. The primary motivation for designing this algorithm is the need to effectively filter out transit travel times, which are often misclassified by existing methods. The algorithms mentioned in Table 1 tend to overlook transit travel times or inadequately assume that non-transit travel times are actually transit, leading to inaccurate quantification of transit traffic volumes. The proposed algorithm begins with the initialization process (line 1), where it establishes a temporal association by assigning time intervals, denoted \(I_{h}\), to each license plate record based on its entry timestamp. These intervals are defined by a start time \(a_{h}\) and an end time \(a_{h}+\Delta t\), where \(\Delta t\) is set to 5 min. The choice of \(\Delta t\) is motivated by the insights obtained from the literature, described in Section 2, which suggest that shorter intervals help capture subtle variations in travel time behavior. This interval length is crucial for accurately reflecting the dynamics of traffic conditions, especially in environments where traffic can fluctuate rapidly. Next (line 2), for each interval \(I_{h}\), a set \(D_{h}=t_{1},t_{2},\ldots,t_{n}\) is formed, representing the travel time values of vehicles that travel along the origin-destination pair route within that time window (Figure 1a). This process ensures that the data are segmented into manageable chunks, allowing for a focused analysis on specific time windows, which is more effective in isolating outliers compared to global approaches that consider the entire data set at once. Transitioning to the main loop (line 3), the algorithm forms a set of three intervals \(T_{h}\) (Figure 1b) for each \(D_{h}\) in the assessed data set (line 4). This three-interval structure is designed to capture the temporal context by considering travel times immediately preceding and following the current interval, providing a more holistic view of traffic conditions. This method addresses the drawback of earlier algorithms that only considered isolated intervals, which often led to misinterpretation of transient traffic patterns as outliers. The set \(T_{h}\) includes the travel times of the previous interval \(D_{h-1}\), the current interval \(D_{h}\), and the subsequent interval \(D_{h+1}\). This structural arrangement was purposefully chosen to evaluate travel times around the time of the assessment, providing a wide perspective of the current state of traffic conditions. This segmentation aligns with the findings of several studies [6, 8, 12, 14, 15], which emphasize the importance of capturing dynamic travel time patterns within distinct temporal boundaries. Subsequently, in the main loop, we calculate the initial threshold value \(x_{c}\) (line 5). This threshold is crucial in identifying potential outliers in shorter travel times by using the median and standard deviation of logarithmic travel times within the set \(T_{h}\), a method chosen to reduce the impact of these low values that could skew the analysis. These values are automatically classified as transit travel times. After determining the cutoff value \(x_{c}\), a subset \(T_{h}^{\prime}\) (line 6) is created that retains only the travel times whose logarithmic values are greater than or equal to \(x_{c}\). This filtering step is implemented to exclude very small values, thereby ensuring that the selected travel times, when ordered in ascending order, show similarity and gradual increase, reflecting meaningful changes in travel time behavior. By ordering the travel times, the algorithm can better detect gradual shifts in travel time trends, which are often indicative of normal traffic conditions, as opposed to abrupt changes typically associated with stops. Note that by ordering the travel times in  
Figure 1: \(T_{h}\) and \(T_{h}^{\prime}\) subsets created from \(I_{h}\) time intervals.