Sie sind auf Seite 1von 2

2014 IEEE 17th International Conference on

Intelligent Transportation Systems (ITSC)


October 8-11, 2014. Qingdao, China

Traffic flow forecasting with Particle Swarm Optimization and


Support Vector Regression
Jianming HU, Member, IEEE, Pan GAO, Yunfei Yao and Xudong XIE

Abstract: In this paper, we propose an algorithm combining


support vector regression (SVR) and particle swarm
optimization (PSO) for traffic flow prediction. The algorithm
uses SVR to establish prediction model and uses PSO to
optimize the parameters of the model. Based on the actual
traffic data test, we prove that the integration of SVR and PSO
is applicable and performs better than multiple linear
regression and BP neural network in traffic flow prediction.
Index Terms: support vector regression (SVR), particle
swarm algorithm (PSO), traffic flow forecasting

I. INTRODUCTION

ccurate prediction of traffic flow can help travelers to


select better path, and thus reducing travel time and
traffic congestion. So many methods for traffic flow
forecasting have been developed in recent years. Support
vector machine(SVM) is a new machine learning
method .The application of SVM to time-series forecasting is
called support vector regression(SVR)[1].Traffic flow
prediction is a typical time series analysis problem, so SVR is
suitable in this field.
For SVR, an important issue is the selection of model
parameters, i.e., penalty C, radius and the kernel function
parameter. In this paper, we will apply PSO algorithm to
optimize the parameters of support vector regression.
According to the actual traffic data, we apply support
vector regression to forecast traffic flow by using the
optimized parameters obtained from PSO. The performance
will be compared with multiple linear regression and BP
neural network regression method.
II. SUPPORT VECTOR REGRESSION
Support vector regression algorithm is a nonlinear
regression algorithm. The input sample is mapped into a high
dimensional feature space by nonlinear mapping , and then
linear regression in that space, estimation function form:

this regression problem is changed into the following


optimization problems:
m in :

|| || C ( i i )
2

i 1

st :
yi f ( x ) i

(2)

f ( x ) yi i

i ,i 0
*

Use the Lagrange multiplier method and use kernel


function k ( x i , x j ) with to replace the original function
( x i ), ( x j ) , we can get the best fitting function is:
l

f ( x)

(3)

i ) k ( x , xi ) b
*

i 1

In this paper,we select RBF as kernels:


k ( xi , x ) exp( || x xi || )
2

(4)

III. PARTICLE SWARM OPTIMIZATION


Particle swarm optimization algorithm is an optimization
algorithm[2]-[3]. The standard particle swarm optimization
algorithm is described as follows:
1) Initialize the particle swarm: including population size
N, each particle's position Xi and velocity Vi .
2) Calculate the fitness i of each particle. Then record the
optimal position

pbest i

of each particle, the optimal fitness

pbestfitness i of each particle, the optimal position gbest of

the particle swarm optimization and the optimal fitness


gbestfitness of the particle swarm optimization.
3) Update the speed and position of each particle, the
velocity updating formula is:
Vi w * Vi c1 * rand () * ( pbest i X i ) c 2 * rand () * ( gbest X i )

4) Calculate the fitness i for every updated particle

f ( x) w ( x) b

(1)
Consider a set of training data {( x1 , y1 ),...( xl , y l )} , we use
-insensitive loss function in support vector machine, then

5) If fitness i < pbestfitness i , then replace

pbest i

with X i and replace pbestfitness i with fitness i


6) If fitness i < gbestfitness , the replace gbest with

Jianming HU, is with the Department of Automation, Tsinghua University


and Beijing Key Laboratory for Cooperative Vehicle Infrastructure Systems
and Safety Control, Beijing, 100084, China, hujm@tsinghua.edu.cn;
Pan GAO, is with the Department of Automation , Tsinghua University,
Beijing, 100084, China, 785896084@qq.com;
Yunfei YAO, is with the Department of Automation , Tsinghua University,
Beijing, 100084, China, 448265950@qq.com;
Xudong XIE, corresponding author, is with the Department of Automation ,
Tsinghua University, Beijing, 100084, China, xdxie@tsinghua.edu.cn
978-1-4799-6078-1/14/$31.00 2014 IEEE

2267

X i and replace gbestfitness with fitness i


7) If the end condition is satisfied, exit, otherwise return 3)

IV. THE EXPERIMENTAL PROCEDURE DESIGN


A. Data sources
This experiment selected traffic flow data in 2nd Ring
Road of Beijing in 2006. We reserve six days of the data and
data of the 23rd detector from 6:15 to 8:45 every day for our
forecasting object. For each output flow(t),select flow(t-4),
flow(t-3), flow(t-2), flow(t-1) of this detector and two
detectors in its upstream sections for input. The training set is
first five days the data, and the test set is sixth days of data.
B. Program design
In order to avoid the over fitting problem in regression,
fitness selection should not only ensure the accuracy of the
training set fitting, but also guarantee the prediction accuracy
on the test data. So we divide the training set into two parts:
the fitting set and validation set. The training data for first 4
days is the fitting set. For a set of parameter C, and ,
support vector regression will give us a regression model. The
training data for the remaining day is the validation set. We
will put validation set data into the model and compare the
output with the actual values, and root mean relative square
error is selected as the fitness of corresponding parameters.
V. PREDICTION RESULTS AND PERFORMANCE COMPARISON
A. Prediction results
We use PSO to find the best parameters. The optimal
population position is obtained by the following table:
0.15
0.148

TABLE I
ERROR COMPARISON

multiple linear
regression

BP neural
network

SVR+PSO

ME

81.9757

108.8060

60.5609

MRE

18.08%

21.69%

11.74%

RMSE

23.15%

25.78%

14.88%

As can be seen, compared with the other two algorithms,


SVR+PSO algorithm has better prediction ability. All the
error indicators are reduced by more than 60%.
VI. CONCLUSION
In this paper, based on the actual data analysis, we prove
that the algorithm of support vector regression in the forecast
of traffic flow compared with other algorithms has obvious
superiority. Performance of support vector regression
algorithm depends on the choice of relevant parameters. In
this paper, the particle swarm algorithm is applied to optimize
the parameters of support vector regression model, which is
also obtained remarkable result.

This work was supported by National Basic Research


Program of China (973 Project) 2012CB725405, the national
science and technology support program (2014BAG03B01),
National Natural Science Foundation China 61273238,
project supported by Tsinghua University (20131089307) and
the Foundation of Beijing Key Laboratory for Cooperative
Vehicle Infrastructure Systems and Safety Control.

0.144

gbestfitness

B. Performance comparison
We choose mean error (ME), root mean square error
(RMSE), and mean relative error (MRE) as the evaluation
criterion. The prediction results of multiple linear regression,
BP neural network[4], SVR+PSO algorithms are shown in the
following table:

ACKNOWLEDGEMENT

0.146

0.142
0.14
0.138
0.136
0.134

As can be seen, this algorithm has good effect on traffic


flow forecasting.

5
6
iterations

10

Fig.1. gbestfitness changing with iterations

For the traffic flow of 30 moments, using SVR+PSO


algorithm, the predictive value and the actual value is shown
below:

REFERENCES
[1]
[2]

900
predict
actual

800

[3]

700

traffic flow

600

[4]

500
400
300
200
100
75

80

85

90
Time of the day

95

100

105

Fig.2. Predicted results by SVR+PSO


2268

TAY, Francis E.H. and Lijuan CAO, Application of support vector


machines in financial time series forecasting,2001.
M. M. Lankhorst, A genetic algorithms for the induction of pushdown
automata, in Proc. of Int. Conf. on Evolutionary Computation, Vol. 2,
pp.741746, 1995.
IoanCristianTrelea, The particle swarm optimization algorithm:
convergence analysis and parameter selection, INAP-G, UMR Gnie et
Microbiologie
des
Procds
Alimentaires,
BP01,
78850Thiverval-Grignon, 2002.
NGSC, CHEUNGCC, LEUNGSH, Fast Convergence for
Back-Propagation
Network
with
Magnified
Gradient
Function[J].IEEE,2003,9(3):1903-1908

Das könnte Ihnen auch gefallen