# Short-Term Speed Prediction Using Remote Microwave Sensor Data: Machine Learning versus Statistical Model

Authors: Han Jiang; Yajie Zou; Shen Zhang; Jinjun Tang; Yinhai Wang
Journal: Mathematical Problems in Engineering
 (2016)

---

## Abstract

Recently, a number of short-term speed prediction approaches have been developed, in which most algorithms are based on machine learning and statistical theory. This paper examined the multistep ahead prediction performance of eight different models using the 2-minute travel speed data collected from three Remote Traffic Microwave Sensors located on a southbound segment of 4th ring road in Beijing City. Specifically, we consider five machine learning methods: Back Propagation Neural Network (BPNN), nonlinear autoregressive model with exogenous inputs neural network (NARXNN), support vector machine with radial basis function as kernel function (SVM-RBF), Support Vector Machine with Linear Function (SVM-LIN), and Multilinear Regression (MLR) as candidate. Three statistical models are also selected: Autoregressive Integrated Moving Average (ARIMA), Vector Autoregression (VAR), and Space-Time (ST) model. From the prediction results, we find the following meaningful results: (1) the prediction accuracy of speed deteriorates as the prediction time steps increase for all models; (2) the BPNN, NARXNN, and SVM-RBF can clearly outperform two traditional statistical models: ARIMA and VAR; (3) the prediction performance of ANN is superior to that of SVM and MLR; (4) as time step increases, the ST model can consistently provide the lowest MAE comparing with ARIMA and VAR.


---

## Body

## 1. Introduction

Collecting high quality traffic information is the key factor to achieve the performance of Intelligent Transportation System (ITS). Accurate prediction of future patterns in traffic flow becomes more important in Advanced Traffic Management System (ATMS) and Advanced Traveler Information Systems (ATIS). Using the forecasted information, such as traffic volume data, travel time data, and traffic condition information, travelers can replan the traveling paths to save their time and cost. Furthermore, transportation agencies can also improve the efficiency of management in traffic system based on forecasted information. Travel speed is an important indicator to estimate traffic conditions in road networks. Compared with general collecting approaches, loop detectors, and GPS equipment, Remote Traffic Microwave Sensor (RTMS) is another important nonintrusive device to directly detect instantaneous travel speed of vehicles. RTMS is installed on the side of the road, and it can directly detect moving or stationary objects without interrupting traffic flow. It can detect traffic volume, occupancy, and speed for multiple lanes simultaneously although sometimes in severe environment. As its high measurement accuracy [1] compared to single loop detector, travel speed data collected from RTMS is used as data source to construct prediction model in this paper.Short-term traffic flow forecasting models rely on the regularity existing in historical data to predict the traffic patterns in future time periods. A good prediction algorithm usually requires advanced technologies and computational ability to capture high-dimensional and nonlinear characteristics in traffic flow data. In the past few years, a large amount of algorithms has been proposed to address traffic prediction problems. Vlahogianni et al. [2] summarized existing short-term traffic predictions algorithms up to 2003. And recently, Vlahogianni et al. [3] updated the literature from 2004 to 2013. Van Lint and Van Hinsbergen [4] reviewed existing applications of neural network and artificial intelligence in short-term traffic forecasting and classified prediction models into two major categories: parametric approach and nonparametric approach. Existing traffic prediction algorithms range from statistical prediction methods [5–10], neural networks [11–15], support vector regression [16–20], Kalman filter theory [21–26], and hybrid approaches [27–32].In order to improve forecasting performance, the neural network model was used to aggregate speed information and acceleration information from the current forecasting segment and adjacent segments. Van Lint et al. [13] proposed a state-space neural network model that utilizes upstream and downstream traffic as model input to predict travel time with respect to missing or corrupt input data. Ma et al. [14] developed a Long Short-Term Memory Neural Network (LSTM) to predict travel speed prediction based on RTMS detection data in Beijing City; the proposed model can capture the long-term temporal dependency for time series and also automatically determine the optimal time window. For the support vector machine, Wu et al. [17] applied support vector regression (SVR) for travel time prediction, and they compared the proposed model with some traditional travel time prediction methods in highway network. Zhang and Liu [18] combined state-space approach and least squares support vector machines (LS-SVMs) to forecast travel time index. Asif et al. [20] firstly analyzed spatiotemporal trends for individual links at the network level and then constructed support vector regression (SVR) to predict travel speed in large interconnected road network. For the Kalman filter theory, Chen and Grant-Muller [22] proposed a Kalman filter type network to predict traffic flow, and they also discussed the effect of starting network parameters to the prediction performance. Chien and Kuchipudi [23] used Kalman filtering algorithm to predict travel time for its significance in continuously updating the state variable as new observations. Their empirical results indicated that the prediction performance based on historic path-based data is better than that based on link-based data during peak hours. Wang et al. [26] proposed a new extended Kalman filter (EKF) based online-learning approach to predict highway travel time. In order to effectively improve prediction performance, many scholars proposed various hybrid models to combine advantages of different kinds of methods. Dimitriou et al. [27] used genetic algorithm to structure an adaptive hybrid fuzzy rule-based system for forecasting traffic flow in urban arterial networks. Zheng et al. [28] introduced a neural network model combined with the theory of conditional probability and Bayes’ rule, and the combined model that is demonstrated outperforms the singular predictors from the experimental test of Singapore’s Ayer Rajah Expressway. Dong et al. [32] proposed a hybrid support vector machine that combines both statistical and heuristic models to consider the spatial-temporal patterns in traffic flow.For the statistical model, Cetin and Comert [5] proposed a new statistical change-point detection algorithm to predict short-term traffic flow, in which the expectation maximization and the CUSUM (cumulative sum) algorithms are implemented to detect shifts. Chandra and Al-Deek [7] considered the effect of upstream and downstream locations on the traffic at a specific location into a traditional Autoregressive Integrated Moving Average (ARIMA) model. Williams and Hoel [8] modeled a seasonal ARIMA process to complete traffic flow forecasting. For the neural networks, Ye et al. [11] used a neural network model to forecast traffic flow time series based on GPS data recorded at irregular time intervals.According to the reviewed literature, most of traffic prediction models are mainly based on statistical methods and machine learning techniques. These two types of models have their different characteristics. The statistical models can provide good theoretical interpretability with clear calculation construction. While machine learning models use a “black box” approach to predict traffic conditions and often lack a good interpretation of the model, however, compared with statistical models, machine learning methods are more flexible with no or little prior assumptions for input variables. In addition, these approaches are more capable of processing outliers, missing and noisy data [33]. In this study, we compare the prediction performances between statistical models and machine learning models. In statistical models, we select ARIMA, Vector Autoregression (VAR), and Space-Time (ST). In machine learning models, we chose Artificial Neural Network (ANN), SVM, and Multilinear Regression (MLR) as candidate. The travel speed data come from RTMS detector on fourth ring freeway in Beijing City. The contribution of this paper includes the following: comprehensively compare speed prediction performances of different models in machine learning and statistical method; analyze the prediction accuracy under different forecasting steps ahead; and evaluate models’ performance under different scenarios.The remainder of paper is organized as follows. Section2 briefly introduces the models used in this study. The data source and analysis are provided in Section 3. Section 4 discusses the results and compares prediction accuracies of different models. Section 5 provides the conclusion of the paper.


## 2. Methodology

### 2.1. Statistical Models

In this section, we briefly introduce three statistical methods (i.e., ARIMA, VAR, and ST) considered in this study.


#### 2.1.1. ARIMA

The Autoregressive Integrated Moving Average (ARIMA)(p,d,q) model contains the following parameters: p is the number of autoregressive terms, d is the number of nonseasonal differences, and q is the number of lagged forecast errors. An ARIMA model can be regarded as a generalization of autoregressive moving average (ARMA) model. The mathematical formulation of an ARMA (p,q) process is defined as follows:(1)xt-ϕ1xt-1-ϕ2xt-2-⋯-ϕpxt-p=ωt+θ1ωt-1+θ2ωt-2+⋯+θqωt-q,where {xt} is stationary, ωt is a normal white noise series with mean zero and variance σw2, {ϕ1,…,ϕp} and {θ1,…,θq} are parameters for the autoregressive and the moving average terms, and the polynomials (1-ϕ1z-⋯-ϕpzp) and (1+θ1z+⋯+θqzq) have no common factors. Assuming Bkxt=xt-k, Bkzt=ωt-k, ϕ(B)=1-ϕ1B-ϕ2B2-⋯-ϕpBp, and θ(B)=1+θ1B+θ2B2+⋯+θqBq, the ARMA (p,q) model can be written as follows: (2)ϕBXt=θBZt.The ARMA model requires that the data series are stationary. When time series data are nonstationary, the ARIMA model is proposed to model the data which does not show evidence of an ARMA model. In the ARIMA model, the integrated part with order d, denoted as I(d), means the dth difference of the original data, which can transform the original data to a stationary series. The mathematical equation of an ARIMA (p,d,q) model is(3)1-ϕ1B-ϕ2B2-⋯-ϕpBp1-BdXt=1+θ1B+θ2B2+⋯+θqBqZt.


#### 2.1.2. VAR

The Vector Autoregression (VAR) model can capture the linear interdependencies among multiple time series and thus can consider the effect of the neighboring stations in predicting the future speed. Here, a 3-equationVAR(m) model is used and its formulation is defined as follows:(4)Xt+1=φ0+φ1Xt+φ2Xt-1+⋯+φmXt-m+1+ut+1,where Xt+1=(At+1,Bt+1,Ct+1)T is the 3 × 1 vector of variables, φ0 is the 3×1 constant term, φ1 through φm are 3×3 coefficient matrices, and ut+1 is the corresponding 3×1 independently and identically distributed random vector with E(ut+1)=0 and time invariant positive definite covariance matrix E(ut+1ut+1T)=Σu. Before applying the VAR(m) model, the characteristic polynomial is evaluated to ensure the stability:(5)det⁡I3-φ1z-⋯-φmzm≠0forz≤1,where I3 is a 3×3 identity matrix. The necessary and sufficient condition for stability is that all characteristic roots lie outside the unit circle.


#### 2.1.3. Space-Time Model

The Space-Time (ST) model is a probabilistic modeling approach that can provide the point prediction of future observations [10]. In probabilistic speed prediction, the commonly used normal distribution is adopted for speed data. Thus, this study assumed that the speed at time t+p at the target station, St+p~N(μt+p,σt+p2), follows a normal distribution. The point prediction of St+p is the mean, μt+p, of the normal distribution. Then, μt+p is fitted by a linear combination of the present and past values of the speed series at all stations. For example, for station B, when p=1 (i.e., 2-minute ahead prediction), (6)μt+1=α0+α1SB,t+α2SB,t-1+α3SA,t+α4SA,t-1+α5SC,t-2,where SA,t, SB,t, and SC,t are the 2-minute average speed at stations A, B, and C at time t; stations A and C are the upstream and downstream of station B, and α0,α1,…,α5 are model coefficients. Predictor variables for μt+p are selected based on an analysis of the speed data from first week of the dataset using a stepwise forward search (refer to [10] for details about predictor variable selection algorithm).


### 2.2. Machine Learning Models

In this section, we select three models, Artificial Neural Network, support vector machine, and Multilinear Regression, to predict travel speed; the following subsections briefly describe these three models.


#### 2.2.1. Artificial Neural Network

Artificial Neural Network (ANN) is a popular tool for traffic flow prediction because of its capability of handling multidimensional data, flexible model structure, strong generalization and learning ability, and adaptability [33]. Different from the statistical methods, ANN does not require underlying assumptions regarding data and is also robust to missing and noisy inputs [33]. ANN model is generally constructed as multiplayer system and it is typically defined by three types of parameters: the interconnection pattern between different layers; the learning process for updating the weights for the layers; the activation function that converts input to output activation. An ANN system can be represented as follows:(7)yann=hφ0+∑j=1Nφjgθ0+∑i=1Mθixi,where M and N, respectively, represent the number of neurons in the input layer and hidden layer and g and h are the transfer functions for the input layer and hidden layer. The vector matrices of h and u, respectively, refer to the weight values for neurons in both input layer and hidden layer. To minimize the sum of estimated errors from ANN, a number of optimization algorithms were developed including Back Propagation Neural Networks, Levenberg-Marquardt method, and genetic algorithm. The detailed information about ANN is introduced in [11–15, 33]. As an important member in ANN family, nonlinear autoregressive model with exogenous inputs neural network (NARXNN) allows a delay line on the inputs, and the outputs feed back to the input by another delay line. This is a further extension of the time delay neural network since the NARXNN not only considers its own previous outputs but also incorporates the exogenous inputs [14].


#### 2.2.2. Support Vector Machine

The main idea of support vector regression is to map data into a high-dimensional feature space through a nonlinear relationship and then construct a linear regression in this space. Given a set of data points(x1,y1),(x2,y2),…,(xN,yN) for regression, N is the number of training samples. The SVM regression function is formulated as follows:(8)fx=wTΦx+b,where w is a vector in a feature space F and Φ(x) is called the feature, which maps the input x to a vector in F. Assume an ε-insensitive loss function:(9)Lεx,y,f=y-fxε=max⁡0,y-fx-ε.Then, w and b are estimated by solving the following optimization problem:(10)C∑i=1NLεxi,yi,f+12w2,where ε is the maximum deviation allowed; C represents the associated penalty for expressing deviation during the training process, which evaluates the trade-off between the empirical risk and the smoothness of the model. The positive slack variables β and β∗ are incorporated, which represent the size of positive and negative excess deviation, respectively. Thus, (10) is transformed to the following constrained formulation:(11)minJβi,βi∗=12w2+C∑i=1Nβi+βi∗subject  to:wTΦx+b-yi≤ε+βi∗yi-wTΦx-b≤ε+βiβi,βi∗≥0.The first term of (11), w2, is the regularized term. Thus, it controls the function capacity. The second term, ∑i=1N(βi+βi∗), is the empirical error measured by ε-insensitive loss function. By using the appropriate Karush-Kuhn-Tucker (KKT) conditions to (11), we have the following dual form of the optimization problem:(12)maxQαi,αi∗=∑i=1Nyiαi-αi∗-ε∑i=1Nαi-αi∗-12∑i=1N∑j=1Nαi-αi∗αj-αj∗Kxi-xjsubject  to:∑i=1Nαi-αi∗=00≤αi≤C0≤αi∗≤C.Therefore, the SVM equation for nonlinear predictions becomes(13)fx=∑i=1Nαi-αi∗Kxi,xi+b,where K(x,xi) is called the kernel function. αi and αi∗ are the solution to the dual problem. There are four conventional kernel functions: linear, radial basis function (RBF), polynomial, and sigmoid. In this study, we select two common functions, linear and RBF, to construct SVM model. The first reason is that these two functions are widely used in prediction and classification. For the second reason, the linear function has advantages of simple construction and low computational time; the RBF function uses nonlinear structure and produces reliable prediction performance based on optimal parameters. For the linear function,(14)Kxi,xj=xiTxj.For the RBF kernel functions,(15)Kxi,xj=exp⁡-γxi-xj2,where γ is the parameter in kernel function.


#### 2.2.3. Multilinear Regression

Compared with the above two supervised algorithms, the construction of multiple linear regressions is simpler and belongs to regression learning category. In MLR, the prediction values can be calculated by the following equation:(16)ymlrk=a0+∑i=1lai·yik-l.ymlr(k) represents the prediction value at the kth period. The independent variable yi(k-l) means the speed data at the previous (k-l)th period, l is the number of historical data considered in MLR, and α0 and αi are the regression parameters which can be optimized by training samples. The prediction values in testing dataset are estimated from (16).


## 2.1. Statistical Models

In this section, we briefly introduce three statistical methods (i.e., ARIMA, VAR, and ST) considered in this study.


### 2.1.1. ARIMA

The Autoregressive Integrated Moving Average (ARIMA)(p,d,q) model contains the following parameters: p is the number of autoregressive terms, d is the number of nonseasonal differences, and q is the number of lagged forecast errors. An ARIMA model can be regarded as a generalization of autoregressive moving average (ARMA) model. The mathematical formulation of an ARMA (p,q) process is defined as follows:(1)xt-ϕ1xt-1-ϕ2xt-2-⋯-ϕpxt-p=ωt+θ1ωt-1+θ2ωt-2+⋯+θqωt-q,where {xt} is stationary, ωt is a normal white noise series with mean zero and variance σw2, {ϕ1,…,ϕp} and {θ1,…,θq} are parameters for the autoregressive and the moving average terms, and the polynomials (1-ϕ1z-⋯-ϕpzp) and (1+θ1z+⋯+θqzq) have no common factors. Assuming Bkxt=xt-k, Bkzt=ωt-k, ϕ(B)=1-ϕ1B-ϕ2B2-⋯-ϕpBp, and θ(B)=1+θ1B+θ2B2+⋯+θqBq, the ARMA (p,q) model can be written as follows: (2)ϕBXt=θBZt.The ARMA model requires that the data series are stationary. When time series data are nonstationary, the ARIMA model is proposed to model the data which does not show evidence of an ARMA model. In the ARIMA model, the integrated part with order d, denoted as I(d), means the dth difference of the original data, which can transform the original data to a stationary series. The mathematical equation of an ARIMA (p,d,q) model is(3)1-ϕ1B-ϕ2B2-⋯-ϕpBp1-BdXt=1+θ1B+θ2B2+⋯+θqBqZt.


### 2.1.2. VAR

The Vector Autoregression (VAR) model can capture the linear interdependencies among multiple time series and thus can consider the effect of the neighboring stations in predicting the future speed. Here, a 3-equationVAR(m) model is used and its formulation is defined as follows:(4)Xt+1=φ0+φ1Xt+φ2Xt-1+⋯+φmXt-m+1+ut+1,where Xt+1=(At+1,Bt+1,Ct+1)T is the 3 × 1 vector of variables, φ0 is the 3×1 constant term, φ1 through φm are 3×3 coefficient matrices, and ut+1 is the corresponding 3×1 independently and identically distributed random vector with E(ut+1)=0 and time invariant positive definite covariance matrix E(ut+1ut+1T)=Σu. Before applying the VAR(m) model, the characteristic polynomial is evaluated to ensure the stability:(5)det⁡I3-φ1z-⋯-φmzm≠0forz≤1,where I3 is a 3×3 identity matrix. The necessary and sufficient condition for stability is that all characteristic roots lie outside the unit circle.


### 2.1.3. Space-Time Model

The Space-Time (ST) model is a probabilistic modeling approach that can provide the point prediction of future observations [10]. In probabilistic speed prediction, the commonly used normal distribution is adopted for speed data. Thus, this study assumed that the speed at time t+p at the target station, St+p~N(μt+p,σt+p2), follows a normal distribution. The point prediction of St+p is the mean, μt+p, of the normal distribution. Then, μt+p is fitted by a linear combination of the present and past values of the speed series at all stations. For example, for station B, when p=1 (i.e., 2-minute ahead prediction), (6)μt+1=α0+α1SB,t+α2SB,t-1+α3SA,t+α4SA,t-1+α5SC,t-2,where SA,t, SB,t, and SC,t are the 2-minute average speed at stations A, B, and C at time t; stations A and C are the upstream and downstream of station B, and α0,α1,…,α5 are model coefficients. Predictor variables for μt+p are selected based on an analysis of the speed data from first week of the dataset using a stepwise forward search (refer to [10] for details about predictor variable selection algorithm).


## 2.1.1. ARIMA

The Autoregressive Integrated Moving Average (ARIMA)(p,d,q) model contains the following parameters: p is the number of autoregressive terms, d is the number of nonseasonal differences, and q is the number of lagged forecast errors. An ARIMA model can be regarded as a generalization of autoregressive moving average (ARMA) model. The mathematical formulation of an ARMA (p,q) process is defined as follows:(1)xt-ϕ1xt-1-ϕ2xt-2-⋯-ϕpxt-p=ωt+θ1ωt-1+θ2ωt-2+⋯+θqωt-q,where {xt} is stationary, ωt is a normal white noise series with mean zero and variance σw2, {ϕ1,…,ϕp} and {θ1,…,θq} are parameters for the autoregressive and the moving average terms, and the polynomials (1-ϕ1z-⋯-ϕpzp) and (1+θ1z+⋯+θqzq) have no common factors. Assuming Bkxt=xt-k, Bkzt=ωt-k, ϕ(B)=1-ϕ1B-ϕ2B2-⋯-ϕpBp, and θ(B)=1+θ1B+θ2B2+⋯+θqBq, the ARMA (p,q) model can be written as follows: (2)ϕBXt=θBZt.The ARMA model requires that the data series are stationary. When time series data are nonstationary, the ARIMA model is proposed to model the data which does not show evidence of an ARMA model. In the ARIMA model, the integrated part with order d, denoted as I(d), means the dth difference of the original data, which can transform the original data to a stationary series. The mathematical equation of an ARIMA (p,d,q) model is(3)1-ϕ1B-ϕ2B2-⋯-ϕpBp1-BdXt=1+θ1B+θ2B2+⋯+θqBqZt.


## 2.1.2. VAR

The Vector Autoregression (VAR) model can capture the linear interdependencies among multiple time series and thus can consider the effect of the neighboring stations in predicting the future speed. Here, a 3-equationVAR(m) model is used and its formulation is defined as follows:(4)Xt+1=φ0+φ1Xt+φ2Xt-1+⋯+φmXt-m+1+ut+1,where Xt+1=(At+1,Bt+1,Ct+1)T is the 3 × 1 vector of variables, φ0 is the 3×1 constant term, φ1 through φm are 3×3 coefficient matrices, and ut+1 is the corresponding 3×1 independently and identically distributed random vector with E(ut+1)=0 and time invariant positive definite covariance matrix E(ut+1ut+1T)=Σu. Before applying the VAR(m) model, the characteristic polynomial is evaluated to ensure the stability:(5)det⁡I3-φ1z-⋯-φmzm≠0forz≤1,where I3 is a 3×3 identity matrix. The necessary and sufficient condition for stability is that all characteristic roots lie outside the unit circle.


## 2.1.3. Space-Time Model

The Space-Time (ST) model is a probabilistic modeling approach that can provide the point prediction of future observations [10]. In probabilistic speed prediction, the commonly used normal distribution is adopted for speed data. Thus, this study assumed that the speed at time t+p at the target station, St+p~N(μt+p,σt+p2), follows a normal distribution. The point prediction of St+p is the mean, μt+p, of the normal distribution. Then, μt+p is fitted by a linear combination of the present and past values of the speed series at all stations. For example, for station B, when p=1 (i.e., 2-minute ahead prediction), (6)μt+1=α0+α1SB,t+α2SB,t-1+α3SA,t+α4SA,t-1+α5SC,t-2,where SA,t, SB,t, and SC,t are the 2-minute average speed at stations A, B, and C at time t; stations A and C are the upstream and downstream of station B, and α0,α1,…,α5 are model coefficients. Predictor variables for μt+p are selected based on an analysis of the speed data from first week of the dataset using a stepwise forward search (refer to [10] for details about predictor variable selection algorithm).


## 2.2. Machine Learning Models

In this section, we select three models, Artificial Neural Network, support vector machine, and Multilinear Regression, to predict travel speed; the following subsections briefly describe these three models.


### 2.2.1. Artificial Neural Network

Artificial Neural Network (ANN) is a popular tool for traffic flow prediction because of its capability of handling multidimensional data, flexible model structure, strong generalization and learning ability, and adaptability [33]. Different from the statistical methods, ANN does not require underlying assumptions regarding data and is also robust to missing and noisy inputs [33]. ANN model is generally constructed as multiplayer system and it is typically defined by three types of parameters: the interconnection pattern between different layers; the learning process for updating the weights for the layers; the activation function that converts input to output activation. An ANN system can be represented as follows:(7)yann=hφ0+∑j=1Nφjgθ0+∑i=1Mθixi,where M and N, respectively, represent the number of neurons in the input layer and hidden layer and g and h are the transfer functions for the input layer and hidden layer. The vector matrices of h and u, respectively, refer to the weight values for neurons in both input layer and hidden layer. To minimize the sum of estimated errors from ANN, a number of optimization algorithms were developed including Back Propagation Neural Networks, Levenberg-Marquardt method, and genetic algorithm. The detailed information about ANN is introduced in [11–15, 33]. As an important member in ANN family, nonlinear autoregressive model with exogenous inputs neural network (NARXNN) allows a delay line on the inputs, and the outputs feed back to the input by another delay line. This is a further extension of the time delay neural network since the NARXNN not only considers its own previous outputs but also incorporates the exogenous inputs [14].


### 2.2.2. Support Vector Machine

The main idea of support vector regression is to map data into a high-dimensional feature space through a nonlinear relationship and then construct a linear regression in this space. Given a set of data points(x1,y1),(x2,y2),…,(xN,yN) for regression, N is the number of training samples. The SVM regression function is formulated as follows:(8)fx=wTΦx+b,where w is a vector in a feature space F and Φ(x) is called the feature, which maps the input x to a vector in F. Assume an ε-insensitive loss function:(9)Lεx,y,f=y-fxε=max⁡0,y-fx-ε.Then, w and b are estimated by solving the following optimization problem:(10)C∑i=1NLεxi,yi,f+12w2,where ε is the maximum deviation allowed; C represents the associated penalty for expressing deviation during the training process, which evaluates the trade-off between the empirical risk and the smoothness of the model. The positive slack variables β and β∗ are incorporated, which represent the size of positive and negative excess deviation, respectively. Thus, (10) is transformed to the following constrained formulation:(11)minJβi,βi∗=12w2+C∑i=1Nβi+βi∗subject  to:wTΦx+b-yi≤ε+βi∗yi-wTΦx-b≤ε+βiβi,βi∗≥0.The first term of (11), w2, is the regularized term. Thus, it controls the function capacity. The second term, ∑i=1N(βi+βi∗), is the empirical error measured by ε-insensitive loss function. By using the appropriate Karush-Kuhn-Tucker (KKT) conditions to (11), we have the following dual form of the optimization problem:(12)maxQαi,αi∗=∑i=1Nyiαi-αi∗-ε∑i=1Nαi-αi∗-12∑i=1N∑j=1Nαi-αi∗αj-αj∗Kxi-xjsubject  to:∑i=1Nαi-αi∗=00≤αi≤C0≤αi∗≤C.Therefore, the SVM equation for nonlinear predictions becomes(13)fx=∑i=1Nαi-αi∗Kxi,xi+b,where K(x,xi) is called the kernel function. αi and αi∗ are the solution to the dual problem. There are four conventional kernel functions: linear, radial basis function (RBF), polynomial, and sigmoid. In this study, we select two common functions, linear and RBF, to construct SVM model. The first reason is that these two functions are widely used in prediction and classification. For the second reason, the linear function has advantages of simple construction and low computational time; the RBF function uses nonlinear structure and produces reliable prediction performance based on optimal parameters. For the linear function,(14)Kxi,xj=xiTxj.For the RBF kernel functions,(15)Kxi,xj=exp⁡-γxi-xj2,where γ is the parameter in kernel function.


### 2.2.3. Multilinear Regression

Compared with the above two supervised algorithms, the construction of multiple linear regressions is simpler and belongs to regression learning category. In MLR, the prediction values can be calculated by the following equation:(16)ymlrk=a0+∑i=1lai·yik-l.ymlr(k) represents the prediction value at the kth period. The independent variable yi(k-l) means the speed data at the previous (k-l)th period, l is the number of historical data considered in MLR, and α0 and αi are the regression parameters which can be optimized by training samples. The prediction values in testing dataset are estimated from (16).


## 2.2.1. Artificial Neural Network

Artificial Neural Network (ANN) is a popular tool for traffic flow prediction because of its capability of handling multidimensional data, flexible model structure, strong generalization and learning ability, and adaptability [33]. Different from the statistical methods, ANN does not require underlying assumptions regarding data and is also robust to missing and noisy inputs [33]. ANN model is generally constructed as multiplayer system and it is typically defined by three types of parameters: the interconnection pattern between different layers; the learning process for updating the weights for the layers; the activation function that converts input to output activation. An ANN system can be represented as follows:(7)yann=hφ0+∑j=1Nφjgθ0+∑i=1Mθixi,where M and N, respectively, represent the number of neurons in the input layer and hidden layer and g and h are the transfer functions for the input layer and hidden layer. The vector matrices of h and u, respectively, refer to the weight values for neurons in both input layer and hidden layer. To minimize the sum of estimated errors from ANN, a number of optimization algorithms were developed including Back Propagation Neural Networks, Levenberg-Marquardt method, and genetic algorithm. The detailed information about ANN is introduced in [11–15, 33]. As an important member in ANN family, nonlinear autoregressive model with exogenous inputs neural network (NARXNN) allows a delay line on the inputs, and the outputs feed back to the input by another delay line. This is a further extension of the time delay neural network since the NARXNN not only considers its own previous outputs but also incorporates the exogenous inputs [14].


## 2.2.2. Support Vector Machine

The main idea of support vector regression is to map data into a high-dimensional feature space through a nonlinear relationship and then construct a linear regression in this space. Given a set of data points(x1,y1),(x2,y2),…,(xN,yN) for regression, N is the number of training samples. The SVM regression function is formulated as follows:(8)fx=wTΦx+b,where w is a vector in a feature space F and Φ(x) is called the feature, which maps the input x to a vector in F. Assume an ε-insensitive loss function:(9)Lεx,y,f=y-fxε=max⁡0,y-fx-ε.Then, w and b are estimated by solving the following optimization problem:(10)C∑i=1NLεxi,yi,f+12w2,where ε is the maximum deviation allowed; C represents the associated penalty for expressing deviation during the training process, which evaluates the trade-off between the empirical risk and the smoothness of the model. The positive slack variables β and β∗ are incorporated, which represent the size of positive and negative excess deviation, respectively. Thus, (10) is transformed to the following constrained formulation:(11)minJβi,βi∗=12w2+C∑i=1Nβi+βi∗subject  to:wTΦx+b-yi≤ε+βi∗yi-wTΦx-b≤ε+βiβi,βi∗≥0.The first term of (11), w2, is the regularized term. Thus, it controls the function capacity. The second term, ∑i=1N(βi+βi∗), is the empirical error measured by ε-insensitive loss function. By using the appropriate Karush-Kuhn-Tucker (KKT) conditions to (11), we have the following dual form of the optimization problem:(12)maxQαi,αi∗=∑i=1Nyiαi-αi∗-ε∑i=1Nαi-αi∗-12∑i=1N∑j=1Nαi-αi∗αj-αj∗Kxi-xjsubject  to:∑i=1Nαi-αi∗=00≤αi≤C0≤αi∗≤C.Therefore, the SVM equation for nonlinear predictions becomes(13)fx=∑i=1Nαi-αi∗Kxi,xi+b,where K(x,xi) is called the kernel function. αi and αi∗ are the solution to the dual problem. There are four conventional kernel functions: linear, radial basis function (RBF), polynomial, and sigmoid. In this study, we select two common functions, linear and RBF, to construct SVM model. The first reason is that these two functions are widely used in prediction and classification. For the second reason, the linear function has advantages of simple construction and low computational time; the RBF function uses nonlinear structure and produces reliable prediction performance based on optimal parameters. For the linear function,(14)Kxi,xj=xiTxj.For the RBF kernel functions,(15)Kxi,xj=exp⁡-γxi-xj2,where γ is the parameter in kernel function.


## 2.2.3. Multilinear Regression

Compared with the above two supervised algorithms, the construction of multiple linear regressions is simpler and belongs to regression learning category. In MLR, the prediction values can be calculated by the following equation:(16)ymlrk=a0+∑i=1lai·yik-l.ymlr(k) represents the prediction value at the kth period. The independent variable yi(k-l) means the speed data at the previous (k-l)th period, l is the number of historical data considered in MLR, and α0 and αi are the regression parameters which can be optimized by training samples. The prediction values in testing dataset are estimated from (16).


## 3. Data Description

The travel speed data used in the study were collected in 4th ring road in Beijing. The segment we selected stretches from Dongfengbei Bridge to Zhaoyang Bridge, and its total length is approximately 2.74 km. This segment experiences significant traffic congestions during peak hours. The speed data were collected from three adjacent stations, which are shown in Figure1. The distance between each two adjacent stations is about 1.4 km. Location A represents detector 9052, location B is detector 9053, and location C indicates detector 9054. All three detectors monitor southbound traffic with frequency of 2 minutes in 24 hours a day. The missing data for the three stations are all less than 3%, and historical averaged based data imputation method has been implemented to ensure that the selected speed data are appropriate for model validation and evaluation in this study. The data collection duration starts from December 1, 2014, to December 31, 2014, total of 31 days. In order to validate the prediction performance of different models and fairly compare the prediction accuracy, we divide data into two parts: training dataset and testing dataset. The data collected from the first 21 days are used to optimize model parameters, and data in last 10 days are employed to validate models effectiveness. The data in first 7 days from each station are plotted in Figure 2 to show the general trends. For three stations, we can see that speed data distribute similar patterns but different speed values. Figure 2 demonstrates clearly sharp reduction of speed during peak hours and also shows that traffic during the night is normally smooth without fluctuation. The speed data collected in locations A and B have similar distribution patterns, and they express obvious periodicity with low speed at evening peak hours. The speed detected in location C represents different patterns compared with A and B. The speed values are lower in evening peak hours than other locations, because traffic here is under high pressure and volumes are much higher in evening peak hours. The limitation of data includes erroneous samples and data missing. To the inaccurate data, for example, speed values are higher than speed limit or speed values are negative, we remove those samples from the original dataset. Furthermore, the data missing can be attributed to many natural and man-made reasons, for example, communication failures, malfunctioning devices, incorrect observations, or data transfer problems. So, aimed at the data collection shortcoming, historical averaged based method has been implemented to impute missing and removed data, which ensures that the selected speed samples are appropriate for model validation and evaluation in this study.Figure 1
Three data collection stations in major ring road, Beijing.Figure 2
Travel speed distribution of three collection locations in 7 days.
(a)
Station A
(b)
Station B
(c)
Station C


## 4. Models Comparison and Results Discussion

In ANN, Back Propagation Neural Network (BPNN) and NARXNN are selected as the candidate models in comparison, and they both have one hidden layer with 50 neurons. We use neural network tool in MATLAB to optimize parameters. In SVM, we use RBF and linear structure as kernel functions. For the parameters optimization, [31] provides detailed introduction. The parameters of ARIMA and VAR models are estimated using the maximum likelihood estimation available in forecast and vars packages in R. The coefficients of the ST model are estimated using the minimum continuous ranked probability score (CRPS) estimation [34]. When forecasting future speed values, the best order of the ARIMA model is determined by the AIC values using the most recent 21 days of speed data. The VAR model is implemented using a maximal order of 10. And the best order of the VAR model is also selected based on the AIC values using the differenced speed data.For all the prediction algorithms, the data in first 21 days are used for training models and data in last 10 days are used for validating models. Two performance measures including the mean absolute error (MAE) and the mean absolute percentage error (MAPE) are used as indicators to evaluate the multistep prediction performances of different models. The unit of the MAE is km per hour. The equations for calculating MAE and MAPE are shown as follows:(17)MAE=∑i=1Nvi¯-viN,MAPE=1N∑i=1Nvi¯-vivi×100%,where N is the number of observations, vi is the actual speed at time i at station, and vi¯ is the predicted speed. Furthermore, in order to further evaluate the performance of all models, both one-step and multistep ahead prediction (i.e., 3-step (6 minutes), 5-step (10 minutes), and 10-step (20 minutes)) are considered. Tables 1, 2, and 3 provide the MAE and MAPE values of different models for different forecasting horizons. Note that, in Table 1, bold values indicate the smallest MAE and MAPE values. Figure 3 shows the prediction results of models for one forecasting step compared with observed speed data in five days. The left column represents the prediction results of machine learning methods and right column represents the prediction results of statistical models. In machine learning, we only show comparison among BPNN, SVM-RBF, and MLR. In statistical models, only prediction performances of ARIMA and ST are compared. Figure 4 displays the correlation between observed values and predicted values from five models (three models in machine learning and two models in statistical method) in ten days, and R2 represents the correlation coefficient to evaluate the relevance between observed and predicted values. Figure 5 shows the frequency distribution of predicted errors of five models in ten days. The x-axis is the errors (errors = predicted value − observed value), and y-axis indicates the frequency in different error ranges. In the figure, r is defined as the rate percentage that errors fell within the range of ±10% to estimate prediction strength of all models. Figure 6 represents the frequency distribution of relative errors of five models in ten days. The x-axis is the relative errors (relative errors = (predicted value − observed value)/observed value), and y-axis indicates the frequency in different error ranges. Similarly, in Figure 6, r is defined as the rate percentage that relative errors fell within the range of ±10% to estimate the performance of models.Table 1
Prediction accuracy of models for different forecasting steps ahead in station A.
MAE
Number of forecasting steps ahead
1
3
5
10
BPNN
2.5027
3.0243
3.4576
4.3553
NARXNN
2.5041
3.0232
3.4482
4.3357
SVM-RBF
2.6537
3.1135
3.4858
4.2625
SVM-LIN
2.7492
3.1160
3.4714
4.2604
MLR
3.0820
3.4795
3.8774
4.6338
ARIMA
2.6777
3.1501
3.5291
4.3233
VAR
2.6835
3.2931
3.7145
4.6030
ST
2.9398
3.1414
3.4932
4.2355
MAPE (%)
Number of forecasting steps ahead
1
3
5
10
BPNN
5.2831
6.4927
7.5472
9.5735
NARXNN
5.2923
6.4995
7.4855
9.6267
SVM-RBF
5.5839
6.6952
7.5901
9.4775
SVM-LIN
5.2878
6.5408
7.6922
9.4937
MLR
5.9048
7.3508
8.1869
9.9782
ARIMA
5.6290
6.7794
7.6974
9.6376
VAR
5.6271
6.7202
8.2556
9.5937
ST
6.1660
6.7725
7.6390
9.5080Table 2
Prediction accuracy of models for different forecasting steps ahead in station B.
MAE
Number of forecasting steps ahead
1
3
5
10
BPNN
2.9402
3.1513
3.3712
3.8135
NARXNN
2.9297
3.1434
3.3591
3.8208
SVM-RBF
2.9825
3.2323
3.4342
3.8567
SVM-LIN
3.1945
3.2111
3.5712
3.8806
MLR
3.2624
3.9019
4.1148
4.5207
ARIMA
3.0144
3.2669
3.4683
3.8959
VAR
3.0244
3.3033
3.7154
4.0356
ST
3.4509
3.2993
3.5093
3.9322
MAPE (%)
Number of forecasting steps ahead
1
3
5
10
BPNN
4.9518
5.3793
5.7737
6.6007
NARXNN
4.9325
5.3470
5.7459
6.6096
SVM-RBF
4.9811
5.4445
5.8253
6.6268
SVM-LIN
5.4039
5.4243
6.2740
6.8330
MLR
5.5909
6.4957
6.8970
7.6689
ARIMA
5.0383
5.5078
5.8899
6.7010
VAR
5.0470
5.6490
6.4091
6.8736
ST
5.7732
5.5666
5.9707
6.7795Table 3
Prediction accuracy of models for different forecasting steps ahead in station C.
MAE
Number of forecasting steps ahead
1
3
5
10
BPNN
2.5694
3.4613
4.1736
5.6407
NARXNN
2.5484
3.4757
4.1458
5.7245
SVM-RBF
2.6617
3.6111
4.2583
5.6255
SVM-LIN
2.8896
3.7087
4.3468
5.6221
MLR
3.9650
3.8713
4.5163
5.9062
ARIMA
2.6675
3.6235
4.2857
5.6745
VAR
2.6611
3.6798
4.3051
5.4380
ST
2.6359
3.5298
4.0963
5.2024
MAPE (%)
Number of forecasting steps ahead
1
3
5
10
BPNN
6.5606
8.9994
11.3564
16.3149
NARXNN
6.4875
9.1176
11.2402
16.6231
SVM-RBF
6.7398
9.3483
11.5343
16.4376
SVM-LIN
7.0707
10.1794
10.9789
15.5072
MLR
7.1717
10.4244
11.3601
16.7207
ARIMA
6.7822
9.4230
11.6734
16.7901
VAR
6.6898
9.1819
11.0211
14.5708
ST
6.6709
8.9993
10.7423
14.3994Figure 3
Prediction result for one step ahead in three stations.
(a)
Results of machine learning for station A
(b)
Results of statistical model for station A
(c)
Results of machine learning for station B
(d)
Results of statistical model for station B
(e)
Results of machine learning for station C
(f)
Results of statistical model for station CFigure 4
Correlation distribution of predicted result for three steps ahead in three stations.
(a)
Station A
(b)
Station B
(c)
Station CFigure 5
Frequency distribution of predicted errors for five steps ahead in three stations.
(a)
Station A
(b)
Station B
(c)
Station CFigure 6
Frequency distribution of relative errors for ten steps ahead in three stations.
(a)
Station A
(b)
Station B
(c)
Station CFrom the observation of four figures, we can gain several conclusions as follows: the BPNN produce better prediction results with higherR2 and r compared with other models; SVM-RBF outperforms ARIMA. The reason is that machine learning models have complex structure and strong learning ability; considering correlation between spatial and temporal characteristics, ST also produces high prediction accuracy; it has similar prediction accuracy with SVM-RBF; MLR is inferior to ARIMA and SVM-RBF with lowest R2 and r for its simple calculation structure.Based on the reported values in tables and corresponding figures, several interesting findings can be obtained:(1)
As expected, the prediction accuracy of speed deteriorates as the prediction time steps increase for all models. The results in Tables1, 2, and 3 show that the MAE and MAPE values for 10-step ahead forecasting are significantly larger than the results of 1-step ahead. From the observation of figures, we can obtain similar results: as the step of prediction increases, the predicted values of all models become more fluctuated, and the prediction accuracy and stability of multistep ahead decrease compared to the results of 1-step ahead prediction.(2)
When comparing the results between machine learning and statistical model, the BPNN, NARXNN, and SVM-RBF can clearly outperform two traditional statistical models: ARIMA and VAR. The reason is that these three machine learning models have complex structure and strong learning ability. Considering correlation between spatial and temporal, ST also produces high prediction accuracy. SVM-LIN produces similar prediction results with ARIMA, and MLR is inferior to ARIMA and VAR.(3)
For the models in machine learning, the prediction performance of ANN is superior to that of SVM and MLR. Furthermore, BP and NARX both achieve similar high accuracy. In the SVM, as RBF is more flexible than linear function, the SVM-RBF outperforms SVM-LIN clearly. As for simple calculation structure, the prediction accuracy of MLR is lower than that of NN and SVM.(4)
For the statistical models, as the time step increases, the ST model can consistently provide the lowest MAE values comparing with ARIMA and VAR. It can be observed that the ST model is preferred over the VAR and ARIMA models when predicting multiple time points into the future. The possible reason is that the ST model uses spatial and temporal information from neighboring stations observed at timet to directly predict the future speed value at time t+p. On the contrary, the ARIMA and VAR models consider t+1’s prediction as an observed value and use it to predict speed at time t+2 and this procedure is repeated p times to forecast speed values at time t+p. Thus, the prediction error may accumulate after multiple steps when using ARIMA and VAR models.(5)
For three stations, we observed that the predicted accuracy in stations A and B is relatively higher than that in station C from Tables1, 2, and 3 and Figures 3, 4, 5, and 6. The reason is that the speed data collected in station C vary sharply from low values to high values, which can be seen in Figure 2. With different distribution patterns in stations A and B, the speed increases rapidly from 20 km/h to about 80 km/h in station C. Moreover, from the observation from Figure 4, we can see that the speed samples in station C are mainly classified into two clusters: low value part and high value part. Due to the lack of the part with continuous increase of speed values, the sharp fluctuation in speed distribution will definitely influence predicted performance of models.Although from the prediction results above we can find that complex machine learning models achieve higher prediction results than statistical methods, it is still a challenging work to select proper model in actual applications. As Karlaftis and Vlahogianni [33] suggested, prediction accuracy is a very important indicator but model simplicity and suitability also should be considered. Kirby et al. [35] stated that accuracy should not be the sole determinant for selecting the proper methodology for prediction; other issues should be considered in selecting the appropriate approach such as the time and effort required for model development, skills and expertise required, transferability of the results, and adaptability to changing behaviors [33, 35]. Between classical statistical models and machine learning algorithms, researchers frequently prefer higher prediction accuracy over explanatory power of model. Karlaftis and Vlahogianni [33] concluded some criteria for model selection between NN and statistical models. Thus, we applied case study to compare the predicted performance between machine learning and statistical models, and the conclusion we obtained in this study is that complex machine learning models have advantages of nonlinear fitting ability and robustness for missing data but low explanatory power, and statistical methods can reach high prediction performance through inherent explanatory structure.


## 5. Conclusions

This paper evaluated the multistep prediction performance of machine learning and statistical models using the speed data collected from three RTMS located on 4th ring road in Beijing City. The data are collected from December 1, 2014, to December 31, 2014, with interval of 2 minutes. In the models performance comparison, we choose five machine learning methods: BPNN, NARXNN, SVM-RBF, SVM-LIN, and MLR, and three conventional statistic models: ARIMA, VAR, and ST model. We firstly provide a brief introduction of each model. In the applications, we then optimize models parameters by using data collected in the first 21 days. Finally, we compare prediction accuracies of different models based on data collected in last 10 days. Based on observation of the results from this study, several interesting conclusions can be drawn. First, the prediction accuracy of speed decreases as the prediction time steps increase for all models. Second, the BPNN, NARXNN, and SVM-RBF are superior to two traditional statistical models: ARIMA and VAR. Third, among the machine learning models, the prediction performance of ANN is better than that of SVM and MLR. Fourth, in the statistical models, as the time step increases, the ST model can consistently provide the lowest MAE values comparing with ARIMA and VAR. The statistical models have good theoretical interpretability and machine learning models are more flexible with no or little prior assumptions for input variables. In addition, machine learning models are more capable of processing outliers, missing and noisy data. Through case study in Beijing based on observed data, this study supplies useful applications of speed prediction and comparisons of prediction performance.



---

*Source: 9236156-2016-02-02.xml*