# Unequal Interval Dynamic Traffic Flow Prediction with Singular Point Detection
## 4 Singular Point Detection and Prediction via Wavelet Transform
### Next Singular Point Prediction via Weighted Similarity Measurement  
The system predicts the position of the next singular point of the observed process to determine the dynamic traffic flow prediction duration, considering the singular point distribution characters of the observed and historical traffic flow signal. The traffic flow data have periodic characteristics. In a long-term traffic flow analysis, [PERSON] et al., found that the same characteristics, e.g., weekday/weekends, workday/holiday, and weather, of the same road segment share similar trends of traffic flow [30]. In a short-term traffic flow analysis, the road segments' traffic flow trend has similarity in peak hours or off-peak period [31]. Therefore, the characteristics of the historical data's singular points provide a basic similarity measurement of a real-time traffic flow's next singular point prediction. Unlike using different reprediction intervals based on the characters of the day [30], or dividing the day into the peak/off-peak periods [31], our method divides the observed process based on the singular point position, which presents the specific and unique traffic flow characters of the real-time data. Since the real-time information (observations) can be used to predict the trend of the traffic flow in the following duration but cannot predict the next traffic flow singular point position itself, the historical traffic data of the same road segment are used to make the next singular point prediction. Through the similarity measurement with weighted parameters, the dynamic unequal interval can be determined and the next singular point position can be predicted. As shown in Figure 2, there are \(i\) detected singular points in the observation before the current time \(t\) via our proposed multiscale wavelet transform method. The historical data have a sequence of completed singular points. Due to the analysis of the similarity measurement [32] with the weighted parameters, the next singular point position is predicted based on historical data results. The weight factor \(w_{k}\) and correction factor \(\eta_{k}\) quantify the similarity measurement results of different historical data. For instance, the patterns of the first historical data are more similar to the observation's than the second historical data. Therefore, the values of \(w_{1}\) and \(\eta_{1}\) are larger than \(w_{2}\) and \(\eta_{2}\), respectively. The position of the next singular point of the observation process can be predicted via the historical data's similarity measurement results by  
\[\widetilde{T}_{i+1}=\sum\limits_{k=1}^{N}w_{k}[(1+\eta_{k})H_{k}(i+1)], \tag{10}\]  
where \(\widetilde{T}_{i+1}\) denotes the predicted value of the real-time traffic data's next singular point. The number of the historical traffic data group is \(N\). \(H_{k}(i+1)\) denotes the position of the \(i+1\)th singular point of the \(k\)th historical traffic data. \(w_{k}\) is the weight factor of the \(k\)th historical data. It depends on the similarity between the observation value and historical traffic data. The large value of \(w_{k}\) means that the \(k\)th historical traffic data's singular point distribution is similar to the observation. Its next singular point position has more weight factor in determining \(\widetilde{T}_{i+1}\) during prediction, which is presented by  
\[w_{k}=\frac{\varepsilon_{k}}{\sum\limits_{k=1}^{N}\varepsilon_{k}}, \tag{11}\]  
where \(\varepsilon_{k}\) denotes the relative error between the observation and historical data that presents as  
\[\varepsilon_{k}=\frac{1}{\sum\limits_{j=1}^{i}[\frac{|T_{j}-H_{k}(j)|}{(T_{j} +H_{k}(j))/2}]-\lambda_{k}}. \tag{12}\]  
Here, the number of the observation's detected singular point is \(i\). \(T_{j}\) denotes the \(j\)th singular point of the observation. \(H_{k}(j)\) denotes the \(j\)th singular point in the \(k\)th historical traffic data.