# Research on Short-Term Traffic Flow Prediction Method Based on Similarity Search of Time Series

Authors: Zhaosheng Yang; Qichun Bing; Ciyun Lin; Nan Yang; Duo Mei
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Short-time traffic flow prediction is necessary for advanced traffic management system (ATMS) and advanced traveler information system (ATIS). In order to improve the effect of short-term traffic flow prediction, this paper presents a short-term 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.


---

## Body

## 1. Introduction

Accurate and real-time 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 short-term 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 in-depth 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 short-term 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 short-term 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 short-term traffic flow forecasting. In addition, many other models were also used for short-term 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, short-term 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 one-step 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 real-time 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 short-term 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 short-term 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 short-term traffic flow multistep forecasting. Figure1 shows the schematic of traffic flow multistep forecasting method.Figure 1
The schematic of traffic flow multistep forecasting method.


## 2. Methodology

### 2.1. Similarity Search of Time Series

There are large numbers of short-term 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 thenth order derivative is 0 at a point, then the point is an nth order landmark of a curve. So local maxima and local minima are first-order landmarks. The inflection points are second-order 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{
(
x
1
,
y
1
)
,
…
,
(
x
i
,
y
i
)
,
…
,
(
x
m
,
y
m
)
}, where x
i is the position of the ith landmark in original time series and y
i is the corresponding time series value, given a minimal distance D and a minimal percentage P, remove (
x
i
,
y
i
) and (
x
i
+
1
,
y
i
+
1
), if
(1)
x
i
+
1
-
x
i
≤
D
,
|
y
i
+
1
-
y
i
|
(
|
y
i
|
+
|
y
i
+
1
|
)
/
2
≤
P
.
The minimal distance/percentage principle is represented as MDPP
(
D
,
P
). Figure 2 illustrates how MDPP works.Figure 2
Minimal distance/percentage principle.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 landmarksL
=
{
L
1
,
L
2
,
…
,
L
n
} and L
′
=
{
L
1
′
,
L
2
′
,
…
,
L
n
′
}, where L
i
=
(
x
i
,
y
i
) and L
i
′
=
(
x
i
′
,
y
i
′
), the distance between the kth landmark is measured by Δ
k
(
L
,
L
′
)
=
(
δ
k
time
(
L
,
L
′
)
,
δ
k
amp
(
L
,
L
′
)
) where
(2)
δ
k
time
(
L
,
L
′
)
=
{
|
(
x
k
-
x
k
-
1
)
-
(
x
k
′
-
x
k
-
1
′
)
|
(
|
(
x
k
-
x
k
-
1
)
|
+
|
x
k
′
-
x
k
-
1
′
|
)
/
2
,
if
1
<
k
≤
n
,
0
,
otherwise,
δ
k
amp
(
L
,
L
′
)
=
{
0
,
if
y
k
=
y
k
′
,
|
y
k
-
y
k
′
|
(
|
y
k
|
+
|
y
k
′
|
)
/
2
,
otherwise.
The distance between the two series is as follows:
(3)
Δ
(
L
,
L
′
)
=
(
∥
δ
time
(
L
,
L
′
)
∥
,
∥
δ
amp
(
L
,
L
′
)
∥
)
=
(
δ
time
(
L
,
L
′
)
,
δ
amp
(
L
,
L
′
)
)
,
where ∥
·
∥ is a vector norm, δ
time
(
L
,
L
′
) denotes the distance in time axis, δ
amp
(
L
,
L
′
)denotes the distance in amplitude axis, and we define (
δ
time
,
δ
amp
)
≤
(
δ
′
time
,
δ
′
amp
) if δ
time
≤
δ
′
time and δ
amp
≤
δ
′
amp.In the process of similarity search of time series, the calculation amount of on-line operation is tremendous due to the pattern representation for each search. In order to reduce the calculation amount of on-line 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 network-echo state networks (ESN) model.As shown in Figure3, the elementary building blocks of ESN are input layer, internal layer, and output layer. u
(
n
) represents input activation vector that consists of K input neurons, x
(
n
) represents internal activation vector that consists of N internal neurons, and y
(
n
) represents output activation vector that consists of L output neurons. The values of input vector, internal vector, and output vector at the time step n are as follows:
(4)
u
(
n
)
=
[
u
1
(
n
)
,
u
2
(
n
)
,
…
,
u
K
(
n
)
]
T
,
x
(
n
)
=
[
x
1
(
n
)
,
x
2
(
n
)
,
…
,
x
N
(
n
)
]
T
,
y
(
n
)
=
[
y
1
(
n
)
,
y
2
(
n
)
,
…
,
y
L
(
n
)
]
T
.Figure 3
The structure of echo state network model.ESN is a special type of neural network. The basic idea of the ESN model is to use recursive network with large-scale 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:(5)
x
(
n
+
1
)
=
f
(
W
x
(
n
)
+
W
in
u
(
n
+
1
)
+
W
back
y
(
n
)
)
,
y
(
n
+
1
)
=
f
out
(
W
out
[
x
(
n
+
1
)
,
u
(
n
+
1
)
,
y
(
n
)
]
)
,
where W, W
in, and W
back denote hidden-hidden, input-hidden, and output-hidden weight matrices, respectively; W
out is output weight matrix; f
=
[
f
1
,
f
2
,
…
,
f
N
] denotes the vector of activation functions of internal neurons, and normally f
i
(
i
=
1,2
,
…
,
N
) uses the hyperbolic tangent function; f
out
=
[
f
out
1
,
f
out
2
,
…
,
f
out
L
] is the vector of activation functions of output neurons, and f
out
j
(
j
=
1,2
,
…
,
L
) usually takes identity function. In the process of network training, W is chosen randomly before training; only W
out should be trained.


### 2.3. Algorithm Process

The short-term 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 Figure4, 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: short-term traffic flow multistep prediction is carried out using echo state networks model.Figure 4
The process of traffic flow multistep prediction method.


## 2.1. Similarity Search of Time Series

There are large numbers of short-term 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 thenth order derivative is 0 at a point, then the point is an nth order landmark of a curve. So local maxima and local minima are first-order landmarks. The inflection points are second-order 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{
(
x
1
,
y
1
)
,
…
,
(
x
i
,
y
i
)
,
…
,
(
x
m
,
y
m
)
}, where x
i is the position of the ith landmark in original time series and y
i is the corresponding time series value, given a minimal distance D and a minimal percentage P, remove (
x
i
,
y
i
) and (
x
i
+
1
,
y
i
+
1
), if
(1)
x
i
+
1
-
x
i
≤
D
,
|
y
i
+
1
-
y
i
|
(
|
y
i
|
+
|
y
i
+
1
|
)
/
2
≤
P
.
The minimal distance/percentage principle is represented as MDPP
(
D
,
P
). Figure 2 illustrates how MDPP works.Figure 2
Minimal distance/percentage principle.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 landmarksL
=
{
L
1
,
L
2
,
…
,
L
n
} and L
′
=
{
L
1
′
,
L
2
′
,
…
,
L
n
′
}, where L
i
=
(
x
i
,
y
i
) and L
i
′
=
(
x
i
′
,
y
i
′
), the distance between the kth landmark is measured by Δ
k
(
L
,
L
′
)
=
(
δ
k
time
(
L
,
L
′
)
,
δ
k
amp
(
L
,
L
′
)
) where
(2)
δ
k
time
(
L
,
L
′
)
=
{
|
(
x
k
-
x
k
-
1
)
-
(
x
k
′
-
x
k
-
1
′
)
|
(
|
(
x
k
-
x
k
-
1
)
|
+
|
x
k
′
-
x
k
-
1
′
|
)
/
2
,
if
1
<
k
≤
n
,
0
,
otherwise,
δ
k
amp
(
L
,
L
′
)
=
{
0
,
if
y
k
=
y
k
′
,
|
y
k
-
y
k
′
|
(
|
y
k
|
+
|
y
k
′
|
)
/
2
,
otherwise.
The distance between the two series is as follows:
(3)
Δ
(
L
,
L
′
)
=
(
∥
δ
time
(
L
,
L
′
)
∥
,
∥
δ
amp
(
L
,
L
′
)
∥
)
=
(
δ
time
(
L
,
L
′
)
,
δ
amp
(
L
,
L
′
)
)
,
where ∥
·
∥ is a vector norm, δ
time
(
L
,
L
′
) denotes the distance in time axis, δ
amp
(
L
,
L
′
)denotes the distance in amplitude axis, and we define (
δ
time
,
δ
amp
)
≤
(
δ
′
time
,
δ
′
amp
) if δ
time
≤
δ
′
time and δ
amp
≤
δ
′
amp.In the process of similarity search of time series, the calculation amount of on-line operation is tremendous due to the pattern representation for each search. In order to reduce the calculation amount of on-line 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 network-echo state networks (ESN) model.As shown in Figure3, the elementary building blocks of ESN are input layer, internal layer, and output layer. u
(
n
) represents input activation vector that consists of K input neurons, x
(
n
) represents internal activation vector that consists of N internal neurons, and y
(
n
) represents output activation vector that consists of L output neurons. The values of input vector, internal vector, and output vector at the time step n are as follows:
(4)
u
(
n
)
=
[
u
1
(
n
)
,
u
2
(
n
)
,
…
,
u
K
(
n
)
]
T
,
x
(
n
)
=
[
x
1
(
n
)
,
x
2
(
n
)
,
…
,
x
N
(
n
)
]
T
,
y
(
n
)
=
[
y
1
(
n
)
,
y
2
(
n
)
,
…
,
y
L
(
n
)
]
T
.Figure 3
The structure of echo state network model.ESN is a special type of neural network. The basic idea of the ESN model is to use recursive network with large-scale 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:(5)
x
(
n
+
1
)
=
f
(
W
x
(
n
)
+
W
in
u
(
n
+
1
)
+
W
back
y
(
n
)
)
,
y
(
n
+
1
)
=
f
out
(
W
out
[
x
(
n
+
1
)
,
u
(
n
+
1
)
,
y
(
n
)
]
)
,
where W, W
in, and W
back denote hidden-hidden, input-hidden, and output-hidden weight matrices, respectively; W
out is output weight matrix; f
=
[
f
1
,
f
2
,
…
,
f
N
] denotes the vector of activation functions of internal neurons, and normally f
i
(
i
=
1,2
,
…
,
N
) uses the hyperbolic tangent function; f
out
=
[
f
out
1
,
f
out
2
,
…
,
f
out
L
] is the vector of activation functions of output neurons, and f
out
j
(
j
=
1,2
,
…
,
L
) usually takes identity function. In the process of network training, W is chosen randomly before training; only W
out should be trained.


## 2.3. Algorithm Process

The short-term 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 Figure4, 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: short-term traffic flow multistep prediction is carried out using echo state networks model.Figure 4
The process of traffic flow multistep prediction method.


## 3. Experiment Setup and Case Study

### 3.1. Data Source and Description

The traffic flow data come from loop detectors located on ten-kilometer 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. Figure5 gives the layout of loop detectors.Figure 5
The layout of the loop detectors.Duo to the stochastic volatility of traffic flow data collected per 20 s, they are rarely used in traffic flow prediction, while five-minute traffic flow data are usually used in practical applications. Therefore, the original traffic flow data have been aggregated into five-minute intervals. In addition, some practical applications such as traffic flow guidance system not only need real-time traffic flow information, but also require the traffic flow information within one hour. So this paper conducts twelve-step prediction for short-term traffic flow data. Figure6(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.Traffic flow data from loop detectors.
(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 p
(
α
). The equations for the MAPE and p
(
α
) are as follows:
(6)
MAPE
=
1
n
∑
i
=
1
n
|
y
(
i
)
-
y
^
(
i
)
y
(
i
)
|
,
p
(
α
)
=
(
(
the
total
number
of
time
intervals
)
-
1
(
t
h
e
M
A
P
E
i
s
i
n
t
h
e
r
a
n
g
e
o
f
α
the
number
of
time
intervals
which
mmmm
the
MAPE
is
in
the
range
of
α
)
×
(
the
total
number
of
time
intervals
)
-
1
)
×
100
%
,
where y
^
(
i
) denotes the predicted value for the ith time interval, y
(
i
) denotes the actual value for the ith time interval, and n 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 first-order landmarks. The MDPP (2.15%) is used to smooth the landmarks series. Figure7 displays the effectiveness of pattern representation.Figure 7
The effectiveness of pattern representation.From Figure7, 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 byl. The other is the number of similar time series denoted by k, 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.Table 1
The MAPE corresponding to different parameter values.
k
=
2
k
=
3
k
=
4
k
=
5
k
=
6
l
=
3
28.6%
25.3%
21.9%
18.4%
18.6%
l
=
4
23.5%
18.5%
17.4%
15.5%
16.3%
l
=
5
21.8%
18.2%
19.7%
16.8%
17.2%
l
=
6
20.6%
17.8%
18.1%
17.2%
18.5%As shown in Table1, the prediction effect is best when k
=
5 and l
=
4, 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, Figure8 gives one-step prediction results based on the proposed method. The results reveal the proposed method’s satisfactory accuracy for short-time traffic flow prediction.Figure 8
The one-step prediction results based on the proposed method.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. Figure9 compares the MAPE of different methods from one-step to twelve-step prediction.Figure 9
The MAPE of different methods from one-step to twelve-step prediction.From Figure9, it can be seen that the MAPE of prediction results from one-step to twelve-step 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 short-term traffic flow multistep prediction method can provide satisfactory and better multistep forecasting results.Figure10 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.Figure 10
The proportion in which the MAPE is less than 5% for different methods.Figure 11
The proportion in which the MAPE is in a different range of the proposed method.


## 3.1. Data Source and Description

The traffic flow data come from loop detectors located on ten-kilometer 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. Figure5 gives the layout of loop detectors.Figure 5
The layout of the loop detectors.Duo to the stochastic volatility of traffic flow data collected per 20 s, they are rarely used in traffic flow prediction, while five-minute traffic flow data are usually used in practical applications. Therefore, the original traffic flow data have been aggregated into five-minute intervals. In addition, some practical applications such as traffic flow guidance system not only need real-time traffic flow information, but also require the traffic flow information within one hour. So this paper conducts twelve-step prediction for short-term traffic flow data. Figure6(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.Traffic flow data from loop detectors.
(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 p
(
α
). The equations for the MAPE and p
(
α
) are as follows:
(6)
MAPE
=
1
n
∑
i
=
1
n
|
y
(
i
)
-
y
^
(
i
)
y
(
i
)
|
,
p
(
α
)
=
(
(
the
total
number
of
time
intervals
)
-
1
(
t
h
e
M
A
P
E
i
s
i
n
t
h
e
r
a
n
g
e
o
f
α
the
number
of
time
intervals
which
mmmm
the
MAPE
is
in
the
range
of
α
)
×
(
the
total
number
of
time
intervals
)
-
1
)
×
100
%
,
where y
^
(
i
) denotes the predicted value for the ith time interval, y
(
i
) denotes the actual value for the ith time interval, and n 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 first-order landmarks. The MDPP (2.15%) is used to smooth the landmarks series. Figure7 displays the effectiveness of pattern representation.Figure 7
The effectiveness of pattern representation.From Figure7, 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 byl. The other is the number of similar time series denoted by k, 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.Table 1
The MAPE corresponding to different parameter values.
k
=
2
k
=
3
k
=
4
k
=
5
k
=
6
l
=
3
28.6%
25.3%
21.9%
18.4%
18.6%
l
=
4
23.5%
18.5%
17.4%
15.5%
16.3%
l
=
5
21.8%
18.2%
19.7%
16.8%
17.2%
l
=
6
20.6%
17.8%
18.1%
17.2%
18.5%As shown in Table1, the prediction effect is best when k
=
5 and l
=
4, 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, Figure8 gives one-step prediction results based on the proposed method. The results reveal the proposed method’s satisfactory accuracy for short-time traffic flow prediction.Figure 8
The one-step prediction results based on the proposed method.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. Figure9 compares the MAPE of different methods from one-step to twelve-step prediction.Figure 9
The MAPE of different methods from one-step to twelve-step prediction.From Figure9, it can be seen that the MAPE of prediction results from one-step to twelve-step 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 short-term traffic flow multistep prediction method can provide satisfactory and better multistep forecasting results.Figure10 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.Figure 10
The proportion in which the MAPE is less than 5% for different methods.Figure 11
The proportion in which the MAPE is in a different range of the proposed method.


## 4. Conclusions

This paper proposed a short-term 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 short-time 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.



---

*Source: 184632-2014-08-18.xml*