Research Article  Open Access
Research on ShortTerm Traffic Flow Prediction Method Based on Similarity Search of Time Series
Abstract
Shorttime traffic flow prediction is necessary for advanced traffic management system (ATMS) and advanced traveler information system (ATIS). In order to improve the effect of shortterm traffic flow prediction, this paper presents a shortterm traffic flow multistep prediction method based on similarity search of time series. Firstly, the landmark model is used to represent time series of traffic flow data. Then the input data of prediction model are determined through searching similar time series. Finally, the echo state networks model is used for traffic flow multistep prediction. The performance of the proposed method is measured with expressway traffic flow data collected from loop detectors in Shanghai, China. The experimental results demonstrate that the proposed method can achieve better multistep prediction performance than conventional methods.
1. Introduction
Accurate and realtime traffic flow forecasting is essential to adaptive traffic control system and traffic guidance system, which is of great significance for alleviating urban traffic congestions. Because of the importance of traffic flow prediction results, many traffic engineering researchers began to apply mature prediction models of other areas to shortterm traffic flow prediction and developed a variety of forecasting methods at the beginning of the 1960s. Earlier prediction methods mainly included autoregressive model, moving average model, autoregressive integrated moving average model [1], and historical average model [2]. The prediction results of these methods were mainly applied to traffic control system. With the gradually indepth study in this field, a series of prediction methods with more complicated and higher precision have been generated. For instance, Nicholson and Swann [3] proposed spectral analysis method to predict the traffic flow in the Mersey Queensway tunnel and obtained satisfactory performance. Stathopoulos and Karlaftis [4] presented a multivariate time series state space model using core urban area loop detector data and found that multivariate state space model could improve the prediction accuracy over univariate time series model. Hu et al. [5] proposed a shortterm traffic flow forecasting method based on chaotic theory, which is a significant attempt to forecast traffic flow from the viewpoint of nonlinear time series. Wang and Shi [6] used support vector machine theory to build a shortterm speed forecasting model. Zhang and Ye [7] put forward a fuzzy logic system (FLS) method to combine the strengths of multiple component predictors and demonstrated that the FLS method could achieve better prediction effect compared to single method. Xie and Zhang [8] proposed wavelet network model using different mother wavelets for shortterm traffic flow forecasting. In addition, many other models were also used for shortterm traffic flow prediction, such as Bayesian network model [9], artificial neural network methods [10–12], cusp catastrophe theory model [13], nonparametric regression models [14], Kalman filtering methods [15, 16], time series models [17], and regression analysis models [18].
Despite number of methods having been put forward to improve forecasting accuracy, shortterm traffic flow forecasting is still a difficult challenge. There are generally two aspects of shortcomings among the existing traffic flow forecasting methods. Most of the achievements mainly focused on the research of model optimization, but ignored the effective use of the similarity characteristics of traffic flow data. Specifically, most of the forecasting models used the traffic flow data which are at the prior time instant of prediction moments as input data. However, the fluctuation of traffic flow has strong randomness. If the input data of prediction model only relies on the data of the prior time instant, there will be large prediction error. In addition, majority of researchers only conducted onestep prediction, which cannot describe the future trend of traffic state sufficiently. There are different requirements for the length of prediction intervals according to different applications. For example, traffic control system needs to grasp recent traffic flow forecasting results for realtime traffic control, while traffic guidance system requires relatively long time forecasting results to be able to understand the trend of traffic state. Therefore, it is essential to establish a shortterm traffic flow multistep forecasting method which can make full use of similarity characteristics of traffic flow data.
Aiming at the shortcomings of the previous traffic flow forecasting methods, this paper presents a shortterm traffic flow multistep prediction method based on similarity search of time series. The general idea of the proposed method mainly includes two parts: first, the input data of prediction model are determined by searching similar time series instead of the data of the prior time instant; second, the echo state networks model is used for shortterm traffic flow multistep forecasting. Figure 1 shows the schematic of traffic flow multistep forecasting method.
2. Methodology
2.1. Similarity Search of Time Series
There are large numbers of shortterm fluctuations and random disturbance in original traffic flow data. The direct use of original time series data for similarity search will not only lead to low efficiency, but also influence the accuracy and reliability. Therefore, many researchers have put forward pattern representation methods of time series. The existing pattern representation methods of time series mainly include discrete Fourier transform method [19], discrete wavelet transform method [20], singular value decomposition method [21], symbolic representation method [22], piecewise linear representation method [23], and landmark model [24]. Among these methods, landmark model not only is able to keep the local characteristics of original data, such as local maximum value and local minimum value, but also has wonderful efficiency. Therefore, the landmark model is selected to represent the original traffic flow time series.
Landmark model proposed by Perng is consistent with human intuition and episodic memory. The basic idea of landmark model is that the searching object is landmarks series rather than the original time series. If the th order derivative is 0 at a point, then the point is an th order landmark of a curve. So local maxima and local minima are firstorder landmarks. The inflection points are secondorder landmarks.
The original time series of traffic flow data is usually noisy. The minimal distance/percentage principle is presented to eliminate noise in landmark model. It is defined as follows.
For a series of landmarks , where is the position of the th landmark in original time series and is the corresponding time series value, given a minimal distance and a minimal percentage , remove and , if The minimal distance/percentage principle is represented as . Figure 2 illustrates how MDPP works.
For most of the similarity models, the error tolerance is a single value which is measured from pointwise differences in amplitude. Nevertheless, landmarks distance is needed to measure similarity in the landmark model. The definition of landmarks distance is given below.
Given two series of landmarks and , where and , the distance between the th landmark is measured by where The distance between the two series is as follows: where is a vector norm, denotes the distance in time axis, denotes the distance in amplitude axis, and we define if and .
In the process of similarity search of time series, the calculation amount of online operation is tremendous due to the pattern representation for each search. In order to reduce the calculation amount of online operation and improve the efficiency of similarity search, it is necessary to build a historical database.
2.2. Echo State Networks Model
Neural network methods are popular among many traffic flow prediction methods. However, traditional neural network models often suffer from slow convergence and local optimum. Either feedforward neural network model or recursion neural network model is limited in practical applications. Aiming at the shortcomings of traditional neural network models, Jaeger and Haas [25] proposed a new type of recursive neural networkecho state networks (ESN) model.
As shown in Figure 3, the elementary building blocks of ESN are input layer, internal layer, and output layer. represents input activation vector that consists of input neurons, represents internal activation vector that consists of internal neurons, and represents output activation vector that consists of output neurons. The values of input vector, internal vector, and output vector at the time step are as follows:
ESN is a special type of neural network. The basic idea of the ESN model is to use recursive network with largescale random connections to replace the middle layer in classical neural network, so as to simplify the network training process. The state equation of echo state networks model is as follows: where , , and denote hiddenhidden, inputhidden, and outputhidden weight matrices, respectively; is output weight matrix; denotes the vector of activation functions of internal neurons, and normally uses the hyperbolic tangent function; is the vector of activation functions of output neurons, and usually takes identity function. In the process of network training, is chosen randomly before training; only should be trained.
2.3. Algorithm Process
The shortterm traffic flow multistep prediction method based on similarity search of time series mainly includes pattern representation of traffic flow time series, similarity search of time series, and prediction model. The basic process is shown in Figure 4, which mainly includes the following steps.(1)Building historical database with the feature of completeness and typicality: the historical traffic flow data which have strong similarity with predicted traffic flow time series are selected to build historical database. Generally, both temporal and dimensional factors should be considered to improve the quality of historical database.(2)Pattern representation of time series: the landmark model is used to represent the historical traffic flow time series and current traffic flow time series, which can improve the efficiency of similarity search.(3)Similarity search of time series: the landmarks distance is calculated between historical time series and current time series to select similar traffic flow time series. The corresponding input data of prediction model are determined according to similar time series.(4)Traffic flow multistep prediction model: shortterm traffic flow multistep prediction is carried out using echo state networks model.
3. Experiment Setup and Case Study
3.1. Data Source and Description
The traffic flow data come from loop detectors located on tenkilometer long expressway in Shanghai, China. This segment includes 24 mainline detecting sections and 30 ramp detecting sections, equipped with 88 mainline loop detectors and 60 ramp loop detectors, respectively. The experimental data are collected on five consecutive Mondays from September 1, 2008, to September 29, 2008. The time interval of collected data is 20 s. Figure 5 gives the layout of loop detectors.
Duo to the stochastic volatility of traffic flow data collected per 20 s, they are rarely used in traffic flow prediction, while fiveminute traffic flow data are usually used in practical applications. Therefore, the original traffic flow data have been aggregated into fiveminute intervals. In addition, some practical applications such as traffic flow guidance system not only need realtime traffic flow information, but also require the traffic flow information within one hour. So this paper conducts twelvestep prediction for shortterm traffic flow data. Figure 6(a) illustrates traffic flow data collected from the same loop detector on different dates. Figure 6(b) plots traffic flow data collected at the same lane with different cross sections. Figure 6(c) plots traffic flow data at the same cross section with different lanes. In summary, Figure 6 indicates that traffic flow data show strong similarity characteristics, which provides enough data support for the proposed method.
(a)
(b)
(c)
3.2. Performance Evaluation Index
In order to evaluate the performance of the proposed traffic flow multistep prediction method, two different types of measurements are introduced: the mean absolute percentage error denoted by MAPE and the proportion which the MAPE is in the range of denoted by . The equations for the MAPE and are as follows: where denotes the predicted value for the th time interval, denotes the actual value for the th time interval, and is the total number of time intervals.
3.3. Parameters Setting
In order to verify the effectiveness of pattern representation, we take the traffic flow data collected from loop detector NBDX08(1) on September 1, 2008, for example. The traffic flow data are represented by using firstorder landmarks. The MDPP (2.15%) is used to smooth the landmarks series. Figure 7 displays the effectiveness of pattern representation.
From Figure 7, the 145 data points of original time series are compressed to 29 landmarks through pattern representation using landmark model. The result indicates that the landmark model can preserve the local characteristics of original time series data and also can effectively reduce the dimensionality of original data.
Two parameters have to be addressed in the process of similarity search. One is the number of landmarks for similarity search denoted by . The other is the number of similar time series denoted by , which is the number of input data for the ESN model. The minimum MAPE using ESN model is taken as criterion during determining the two parameters. According to the setting principle of the key parameters for ESN model [26], the reservoir size is set to 50, the spectral radius is 0.75, the input extension is 0.2, and the sparse degree is 0.1, respectively. The traffic flow data collected on September 1, September 8, September 15, and September 22, 2008, are used to build historical database. The data collected on September 29, 2008, are used to test the predicted performance. Table 1 illustrates the MAPE corresponding to different parameter values.

As shown in Table 1, the prediction effect is best when and , the MAPE is only 15.5%. Therefore, the number of landmarks is set to 5, and the number of similar time series is set to 4.
3.4. Model Performance and Discussions
In order to display the predicted effect of the proposed method intuitively, Figure 8 gives onestep prediction results based on the proposed method. The results reveal the proposed method’s satisfactory accuracy for shorttime traffic flow prediction.
Because of their well theoretical foundation and effectiveness in prediction, the ARIMA model and BPNN model gradually have become standard methods to compare with newly developed forecasting models. Therefore, this paper considers ARIMA model and BPNN model as standard methods to evaluate the effectiveness of the proposed method. In addition, the ESN model whose input data are the data at the prior time instant of prediction moments is also selected as comparison method. The orders of the ARIMA model are determined based on the AIC criteria. The parameters of the BPNN model are selected as follows: the number of input layer units is 5, the number of output layer units is 1, the number of hidden layer units is 8, the activation function of hidden layer units is selected to sigmoid function, and the activation function of output units is liner function. Figure 9 compares the MAPE of different methods from onestep to twelvestep prediction.
From Figure 9, it can be seen that the MAPE of prediction results from onestep to twelvestep shows increasing trend on the whole, which indicates that there is a certain positive correlation between the MAPE and the number of prediction steps. The experimental results also demonstrate that the overall performance of the ESN model whose input data are the data at the prior time instant of prediction moments has an extra 6.25% improvement over the ARIMA models and an extra 3.85% improvement over the BPNN model. It is clear that the ESN model is superior to ARIMA model and BPNN model. Furthermore, through comparing the prediction results between the proposed method and the ESN model whose input data are the data at the prior time instant of prediction moments, we can find that the proposed method can further enhance the accuracy of multistep prediction. The MAPE of the proposed method is about 15.5%, while the MAPE of ESN model whose input data are the data at the prior time instant of prediction moments is about 17%. Therefore, the proposed shortterm traffic flow multistep prediction method can provide satisfactory and better multistep forecasting results.
Figure 10 compares the proportion in which the MAPE is less than 5% with four different prediction methods. The results demonstrate that the percentage of which the MAPE is less than 5% based on the proposed method reaches up to 32.8%, which is superior to the other three methods. Figure 11 gives the proportion in which the MAPE is, respectively, in the range of [0, 5%], [5%, 10%], [10%, 15%], [15%, 20%], and [20%, ] based on the proposed method. The results show that the proportion in which the MAPE is less than 20% can reach up to 89.5%, where the proportion in which the MAPE is in the range of [0, 5%] and [5%, 10%] is, respectively, 32.8% and 30.6%. In summary, the proposed method can achieve high quality forecasting results in most of the time, which can further demonstrate the excellent multistep prediction performance of the proposed method.
4. Conclusions
This paper proposed a shortterm traffic flow multistep prediction method based on similarity search of time series. The landmark model was used to represent original time series of traffic flow data. Furthermore, the input data of prediction model were determined through searching similar time series from historical database. Finally, the echo state networks model was used for shorttime traffic flow multistep prediction. Expressway traffic flow data collected from Shanghai were employed to evaluate the prediction performance of the proposed method. The experimental results demonstrated that the proposed method can achieve satisfactory accuracy and the MAPE of the proposed method is about 15.5%. The comparative analysis showed that the multistep prediction performance of the proposed method not only outperformed ARIMA model and BPNN model, but also outperformed ESN model whose input data are the data at the prior time instant of prediction moments. In addition, the proportion in which the MAPE is less than 20% based on the proposed method could reach up to 89.5%, which indicated that the proposed method can achieve high quality forecasting results in most of the time.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
The authors express their sincere appreciation to the Chinese National High Technology Research and Development Program Committee for the financial support provided under Grant no. 2014BAG03B03, China Postdoctoral Science Foundation no. 2013T60331, and Specialized Research Fund for the Doctoral Program of Higher Education no. 20120061120046.
References
 M. M. Hamed, H. R. AlMasaeid, and Z. M. Bani Said, “Shortterm prediction of traffic volume in urban arterials,” Journal of Transportation Engineering, vol. 121, no. 3, pp. 249–254, 1995. View at: Publisher Site  Google Scholar
 J. Yorgos and G. Stephanedes, “Improved estimation of traffic flow for real time control,” Transportation Research Record, vol. 795, pp. 28–39, 1981. View at: Google Scholar
 H. Nicholson and C. D. Swann, “The prediction of traffic flow volumes based on spectral analysis,” Transportation Research, vol. 8, no. 6, pp. 533–538, 1974. View at: Publisher Site  Google Scholar
 A. Stathopoulos and M. G. Karlaftis, “A multivariate state space approach for urban traffic flow modeling and prediction,” Transportation Research C: Emerging Technologies, vol. 11, no. 2, pp. 121–135, 2003. View at: Publisher Site  Google Scholar
 J. Hu, C. Zong, J. Zhang et al., “An applicable shortterm traffic flow forecasting method based on chaotic theory,” Intelligent Transportation Systems, vol. 1, no. 1, pp. 608–613, 2003. View at: Google Scholar
 J. Wang and Q. Shi, “Shortterm traffic speed forecasting hybrid model based on chaos–wavelet analysissupport vector machine theory,” Transportation Research Part C: Emerging Technologies, vol. 27, no. 1, pp. 219–232, 2013. View at: Publisher Site  Google Scholar
 Y. Zhang and Z. Ye, “Shortterm traffic flow forecasting using fuzzy logic system methods,” Journal of Intelligent Transportation Systems, vol. 12, no. 3, pp. 102–112, 2008. View at: Publisher Site  Google Scholar
 Y. Xie and Y. Zhang, “A wavelet network model for shortterm traffic volume forecasting,” Journal of Intelligent Transportation Systems: Technology, Planning, and Operations, vol. 10, no. 3, pp. 141–150, 2006. View at: Publisher Site  Google Scholar  Zentralblatt MATH
 E. Castillo, J. M. Menéndez, and S. SánchezCambronero, “Predicting traffic flow using Bayesian networks,” Transportation Research B: Methodological, vol. 42, no. 5, pp. 482–509, 2008. View at: Publisher Site  Google Scholar
 Y. Wei and M. Chen, “Forecasting the shortterm metro passenger flow with empirical mode decomposition and neural networks,” Transportation Research C: Emerging Technologies, vol. 21, no. 1, pp. 148–162, 2012. View at: Publisher Site  Google Scholar
 K. Kumar, M. Parida, and V. K. katiyar, “Short term traffic flow prediction for a non urban highway using artificial neural network,” ProcediaSocial and Behavioral Sciences, vol. 104, pp. 755–764, 2013. View at: Google Scholar
 H. B. Yin, S. C. Wong, J. Xu, and C. K. Wong, “Urban traffic flow prediction using a fuzzyneural approach,” Transportation Research C: Emerging Technologies, vol. 10, no. 2, pp. 85–98, 2002. View at: Publisher Site  Google Scholar
 A. Pushkar, F. L. Hall, and J. A. AchaDaza, “Estimation of speeds from singleloop freeway flow and occupancy data using cusp catastrophe theory model,” Transportation Research Record, no. 1457, pp. 149–157, 1994. View at: Google Scholar
 S. Clark, “Traffic prediction using multivariate nonparametric regression,” Journal of Transportation Engineering, vol. 129, no. 2, pp. 161–168, 2003. View at: Publisher Site  Google Scholar
 I. Okutani and Y. J. Stephanedes, “Dynamic prediction of traffic volume through Kalman filtering theory,” Transportation Research B, vol. 18, no. 1, pp. 1–11, 1984. View at: Google Scholar
 J. Whittaker, S. Garside, and K. Lindveld, “Tracking and predicting a network traffic process,” International Journal of Forecasting, vol. 13, no. 1, pp. 51–61, 1997. View at: Publisher Site  Google Scholar
 W. Min and L. Wynter, “Realtime road traffic prediction with spatiotemporal correlations,” Transportation Research C: Emerging Technologies, vol. 19, no. 4, pp. 606–616, 2011. View at: Publisher Site  Google Scholar
 Y. Kamarianakis, H. Oliver Gao, and P. Prastacos, “Characterizing regimes in daily cycles of urban traffic using smoothtransition regressions,” Transportation Research C: Emerging Technologies, vol. 18, no. 5, pp. 821–840, 2010. View at: Publisher Site  Google Scholar
 R. Agrawal, C. Faloutsos, and A. Swami, “Efficient similarity search in sequence databases,” in Proceedings of the 4th International Conference of Foundation of Data Organization and Algorithms (FODO '93), pp. 69–84, Chicago, Ill, USA, 1993. View at: Google Scholar
 K. Chan and A. W. Fu, “Efficient time series matching by wavelets,” in Proceedings of the 15th International Conference on Data Engineering (ICDE '99), pp. 126–133, Sydney, Australia, March 1999. View at: Google Scholar
 E. Keogh, K. Chakrabarti, S. Mehrotra, and M. Pazzani, “Locally adaptive dimensionality reduction for indexing large time series databases,” in Proceedings of the ACM SIGMOD International Conference on Management of Data, pp. 151–162, Santa Barbara, Calif, USA, May 2001. View at: Google Scholar
 J. Lin, E. Keogh, L. Wei, and S. Lonardi, “Experiencing SAX: a novel symbolic representation of time series,” Data Mining and Knowledge Discovery, vol. 15, no. 2, pp. 107–144, 2007. View at: Publisher Site  Google Scholar  MathSciNet
 E. J. Keogh and M. J. Pazzani, “An indexing scheme for fast similarity search in large time series databases,” in Proceedings of the 11th International Conference on Scientific and Statistical Database Management (SSDBM '99), pp. 56–67, Cleveland, Ohio, USA, July 1999. View at: Publisher Site  Google Scholar
 C. S. Perng, H. Wang, S. R. Zhang, and D. S. Parker, “Landmarks: a new model for similaritybased pattern querying in time series databases,” in Proceedings of the IEEE 16th International Conference on Data Engineering (ICDE '00), pp. 33–42, San Diego, Calif , USA, March 2000. View at: Google Scholar
 H. Jaeger and H. Haas, “Harnessing nonlinearity: prediction of chaotic time series with neural networks,” Science, vol. 304, no. 5667, pp. 78–80, 2004. View at: Publisher Site  Google Scholar
 M. Lukoševičius and H. Jaeger, “Reservoir computing approaches to recurrent neural network training,” Computer Science Review, vol. 3, no. 3, pp. 127–149, 2009. View at: Publisher Site  Google Scholar
Copyright
Copyright © 2014 Zhaosheng Yang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.