# Urban Traffic State Estimation with Online Car-Hailing Data: A Dynamic Tensor-Based Bayesian Probabilistic Decomposition Approach

Authors: Wenqi Lu; Ziwei Yi; Dongyu Luo; Yikang Rui; Bin Ran; Jianqing Wu; Tao Li
Journal: Journal of Advanced Transportation
 (2022)

---

## Abstract

Timely and precise traffic state estimation of urban roads is significant for urban traffic management and operation. However, most of the advanced studies focus on building complex deep learning structures to learn the spatiotemporal feature of the urban traffic flow, ignoring improving the efficiency of the traffic state estimation. Considering the benefit of the tensor decomposition, we present a novel urban traffic state estimation based on dynamic tensor and Bayesian probabilistic decomposition. Firstly, the real-time traffic speed data are organized in the form of a dynamic tensor which contains the spatiotemporal characteristics of the traffic state. Then, a dynamic tensor Bayesian probabilistic decomposition (DTBPD) approach is built by decomposing the dynamic tensor into the outer product of several vectors. Afterward, the Gibbs sampling method is introduced to calibrate the parameters of the DTBPD models. Finally, the real-world traffic speeds data extracted from online car-hailing trajectories are employed to validate the model performance. Experimental results indicate that the proposed model can greatly reduce computational time while maintaining relatively high accuracy. Meanwhile, the DTBPD model outperforms the state-of-the-art models in terms of both single-step-ahead and multistep-ahead traffic state estimation.


---

## Body

## 1. Introduction

With the rapid advancement of urbanization, urban traffic congestion has become a critical problem in the construction of smart cities [1]. It may take place when the traffic demand is beyond the capacity of the road network, resulting in more traffic accidents, severe air pollution, and increased fuel consumption [2]. As a significant part of the intelligent transportation system and automated vehicle technology [3], accurate estimation of the urban road network traffic state in the near future is very important for traffic management and planning in reducing traffic congestion. By providing accurate and comprehensive network state estimation information, human-driven vehicles and connected automated vehicles (CAV) can optimize travel paths and generate lane-changing recommendations [4]. Fleet management companies are capable of operating the dispatch system more efficiently [5]. Traffic management agencies can update the control plan in real time to improve control performance. Besides, the traffic policy-making department can analyze emerging needs and evaluate the policy impact [6, 7].During these years, many approaches have been proposed for the estimation traffic state of the urban roads including statistical models [8], artificial-based intelligent models [9], and deep learning-based models [10]. From the perspective of the research objects, the macroscopic parameters of the lane sections, intersection, link sections, and road networks, such as travel speed, volume, and density, are usually considered as the estimated targets [11].However, the challenges of the urban traffic state estimation still exist as follows. (1) The collection of urban traffic data may still rely on stationary detectors or cameras, which is expensive and inflexible. It is not usually a realistic choice to deploy sufficient detectors on low-level roads such as secondary roads and access roads. The traffic states of some low-level roads are always neglected though they may have a significant influence on the future state of the urban network [11]. (2) Though the deep learning-based models are capable of learning the spatiotemporal feature of urban traffic state, the performance of these methods is partly influenced by the quantity and quality of the research data. Achieving a well-trained deep learning model is time-consuming, and it is difficult to update the parameters of the trained models in a short time.Nowadays, the massive trajectory data of various car-hailing companies have become a popular and alternative source for analyzing traffic operation and traffic emissions [12–14], and it also provides the basis for the urban traffic state estimation since the trajectory data are high-precision, high-resolution, and widely distributed. In addition, the tensor-based approaches turn out to be efficient for dealing with traffic data due to their ability to capture the multimode relevance of data [15–18], and it provides a new perspective on modeling.Inspired by the rise of ride-hailing trajectory data and the benefit of tensor mode, this paper proposes a traffic state estimation model based on dynamic tensor Bayesian probabilistic decomposition (DTBPD). Firstly, the concept of the dynamic tensor is introduced to form the urban spatiotemporal data into the tensor pattern. Then a higher-order Bayesian matrix factorization model is established based on CANDECOMP/PARAFAC (CP) decomposition. Meanwhile, the Gibbs sampling algorithm is established to perform inference on the element of the Bayesian decomposition model. Finally, we utilize the urban traffic speed data captured from online car-hailing trajectory data provided by the Didi company to validate the feasibility of the DTBPD approach under the scenarios of different types of roads. As far as the authors know, this is the first time that a dynamic tensor-based probabilistic paradigm has been employed for urban traffic state estimation.The main contributions of this paper can be summarized as follows:(1)
The traffic speeds of the urban network are organized in the form of the dynamic tensor pattern with consideration of the spatiotemporal features for the first time.(2)
We propose a dynamic tensor Bayesian probability decomposition structure that is capable of modeling the dynamic tensor in real time with highly spatiotemporal data and provide a Gibbs sampling algorithm for estimating model parameters.(3)
The traffic speeds of the urban network are extracted from the online car-hailing trajectory data of Didi company and used for validating the efficiency of the DTBPD model under multiple scenarios. Experimental results demonstrate that the DTBPD model is not only accurate but also time-saving during the calibration process.In the next section, a general overview of related work on urban traffic estimation is provided. Section3 gives the basic definition of tensor decomposition. The methodology of the DTBPD model is introduced in Section 4. In Section 5, trajectory data description and preprocessing with data analysis are provided. The results and discussion of the experiments are introduced in Section 6. Some conclusions and future work are discussed in Section 7.


## 2. Related Work

The methods for estimating traffic state usually can be categorized into two classes including the parametric methods and nonparametric methods.The common parametric methods include the statistical method, time-series method, and Kalman filter method [11]. In the time series method, the most common method is the Autoregressive integrated moving average model (ARIMA) and Ahmed and Cook [19] applied it to the traffic state estimation. Since ARIMA is only applicable to several scenarios with continuous and sufficient historical data, many scholars extended the ARIMA such as seasonal ARIMA (SARIMA) [20]. Another typical nonparametric approach is Kalman filter-based methods. Using the information of CAVs, Emami et al. [21] gave a faded memory Kalman filter to forecast the short-term flow at urban arterials. However, the parametric methods normally have fixed structures and are unable to fully learn the spatiotemporal characteristics of traffic flow.With the development of mobile communication networks and big data, the nonparametric methods represented by machine learning models emerged to deal with the above issues [22–24]. For example, Castro-Neto et al. [25] built an online support vector machine model considering normal conditions and abnormal conditions such as accidents. Sun et al. [26] proposed a dynamic process K-nearest Neighbor method, which enables KNN parameters to be self-adjusted and robust without the need to predefine models or train parameters.In addition, the excellent performance of deep learning (DL) in processing massive data has also attracted extensive attention, and it has been widely used in computer vision, semantic recognition, and automatic driving. In recent years, DL-based models [27–31] have been introduced into traffic flow estimation. Lv et al. [32] proposed a deep architecture model considering the temporal and spatial characteristics of the traffic flow by employing the autoencoder. To solve the long-term dependence in the prediction process, some variants of recurrent neural networks (RNN), such as long short-term memory (LSTM) neural network [33], Gated recurrent unit (GRU) neural network [34], and Transformer [35] were proposed and applied to learning the temporal characteristics for the traffic state estimation. Ma et al. [36] represented traffic flow data as images and used a convolutional neural network-based architecture to estimate the traffic state in a large network. Furthermore, some DL-based combination models [37–40] have been proposed to improve the ability to learn spatiotemporal features and the robustness of the estimation. Wu et al. [41] proposed a traffic flow prediction model with a hybrid DL neural network, where convolutional neural networks (CNN) and RNN were used to extract spatiotemporal features, respectively, and an attention mechanism was introduced to determine the importance of historical data. Li et al. [42] employed a deep fusion model combining stacked restricted Boltzmann machines to forecast the accident duration. To capture the spatial and temporal dependences simultaneously, Zhao et al. [43] constructed a novel neural network-based traffic forecasting method named T-GCN, which combines the graph convolutional network (GCN) [44] and the GRU for traffic forecasting. Although the DL-based traffic state estimation approaches can fully mine the potential characteristics of the traffic flow, DL-based traffic state estimation approaches take a long time to train or calibrate the models, resulting in inconvenient and inflexible updates of the parameters [45]. Meanwhile, tuning the parameters of a DL-models reasonably is a very difficult task and highly depends on experience, which prevents these models from being used in practice [29].To tackle the above problem, tensor-based methods [18, 46–48] have become new solutions for traffic estimation issues due to their efficient architecture to mine temporal and spatial correlations of the traffic flow. Ran et al. [49] built a tucker decomposition-based imputation method for the traffic state estimation of the floating car system. Further, Ran et al. [50] provided a high accuracy low-rank tensor completion (HaLRTC) algorithm for estimating missing traffic speed data, and it can address the extreme case where the data of a long period of one or several weeks are completely missing [51]. However, these models rely on trace norm minimization to find a low-rank approximation to the original incomplete tensor, and they are often prone to overfitting when the missing rate is large. To address this issue, Bayesian inference methods such as the Markov chain Monte Carlo algorithm and variational inference have been designed and used for tensor decomposition [52]. For instance, Tang et al. [53] constructed a tensor decomposition method to estimate traffic flow parameters of signalized intersections with collected vehicle trajectories. Using the large-scale and sparse GPS data generated by taxicabs, Tang et al. [54] established a novel tensor-based Bayesian probabilistic model for estimating the travel time of the road links. To efficiently capture the spatiotemporal characteristics of traffic flow with tensor pattern and improve the performance of the tensor decomposition approach, we combine the concept of the dynamic tensor with the Bayesian probabilistic decomposition (DTBPD) for the first time. By establishing a Gibbs sampling algorithm to estimate the proposed model constantly and dynamically, the future traffic state data in dynamic tensor can be generated efficiently and stably.


## 3. Tensor Basis

### 3.1. Dynamic Tensor

Tensors known as multidimensional arrays are higher-order generalizations of vectors and matrices. Thedth-order tensor is donated as X∈ℝI1×I2×…Id. Each dimension of a multidimensional array is called a mode. A sequence of dth-order tensors X1,X2,X3,…,XT with Xt∈ℝI1×I2×…Id1≤t≤T can be donated as a d+1th-order tensor steam where T is the maximum index of the time intervals. Figure 1 indicates an example of the tensor stream of the dth-order Xt∈ℝI1×I2×…Id.Figure 1
The schematic diagram of adth-order tensor stream.In the task of making traffic speed estimation of urban traffic state, only spatiotemporal characteristics of the tensors from several previous time intervals in the tensor stream are necessary. Therefore, a sliding time windowH at time interval t is employed to localize the tensor stream into a small one, which can be written as X˜t=Xt-H+1,Xt-H+2,…,Xt. Figure 2 reveals the tensor stream separated by employing a sliding time window.Figure 2
The divided tensor stream with a time horizon.


### 3.2. CANDECOMP/PARAFAC Decomposition

LetX˜∈ℝI1×I2×…Id be the dynamic tensor containing the observed historical values and missing values to be forecasted, where Ik is the dimension along the kth way k∈1,2,…,d. xi1,i2,..,id (1≤ik≤Ik) is a value of an entry in X˜. The idea of CP decomposition is to approximate X˜ by calculating the sum of R rank-one component tensors as follows:(1)X˜=∑r=1Rar1∘ar2∘⋯∘ard,where ∘ represent the outer product of two vectors. ark∈ℝIk is the rth column vector of the decomposed factor matrix A∈ℝIk×R and ar1∘ar2∘⋯∘ard is a rank-one tensor. R is the CP rank of the tensor X˜. Correspondingly, the element x˜i1,i2,…,id in the tensor X˜ is written as follows:(2)x˜i1,i2,…,id=∑r=1Rai1,r1ai2,r2…aid,rd,i1=1,2,…,I1,…,id=1,2,…,Id,where aik,rk is the element with an index of (ik,r) in the factor matrix Ak∈ℝIk×R.


## 3.1. Dynamic Tensor

Tensors known as multidimensional arrays are higher-order generalizations of vectors and matrices. Thedth-order tensor is donated as X∈ℝI1×I2×…Id. Each dimension of a multidimensional array is called a mode. A sequence of dth-order tensors X1,X2,X3,…,XT with Xt∈ℝI1×I2×…Id1≤t≤T can be donated as a d+1th-order tensor steam where T is the maximum index of the time intervals. Figure 1 indicates an example of the tensor stream of the dth-order Xt∈ℝI1×I2×…Id.Figure 1
The schematic diagram of adth-order tensor stream.In the task of making traffic speed estimation of urban traffic state, only spatiotemporal characteristics of the tensors from several previous time intervals in the tensor stream are necessary. Therefore, a sliding time windowH at time interval t is employed to localize the tensor stream into a small one, which can be written as X˜t=Xt-H+1,Xt-H+2,…,Xt. Figure 2 reveals the tensor stream separated by employing a sliding time window.Figure 2
The divided tensor stream with a time horizon.


## 3.2. CANDECOMP/PARAFAC Decomposition

LetX˜∈ℝI1×I2×…Id be the dynamic tensor containing the observed historical values and missing values to be forecasted, where Ik is the dimension along the kth way k∈1,2,…,d. xi1,i2,..,id (1≤ik≤Ik) is a value of an entry in X˜. The idea of CP decomposition is to approximate X˜ by calculating the sum of R rank-one component tensors as follows:(1)X˜=∑r=1Rar1∘ar2∘⋯∘ard,where ∘ represent the outer product of two vectors. ark∈ℝIk is the rth column vector of the decomposed factor matrix A∈ℝIk×R and ar1∘ar2∘⋯∘ard is a rank-one tensor. R is the CP rank of the tensor X˜. Correspondingly, the element x˜i1,i2,…,id in the tensor X˜ is written as follows:(2)x˜i1,i2,…,id=∑r=1Rai1,r1ai2,r2…aid,rd,i1=1,2,…,I1,…,id=1,2,…,Id,where aik,rk is the element with an index of (ik,r) in the factor matrix Ak∈ℝIk×R.


## 4. Dynamic Tensor-Based Bayesian Probabilistic Decomposition Approach

This section demonstrates a dynamic tensor-based Bayesian probabilistic decomposition approach for estimating the urban traffic states. As a common indicator of evaluating the traffic states, the average speed of the vehicle on a link section during a time interval is utilized to represent the traffic state.


### 4.1. Problem Statement

Road network speed estimation is to predict the traffic speed in the future by using the speed data of the existing historical time.DefineX¯∈ℝI1×I2×…×In as the nth-order tensor flow represented by road network speed data. I1,…,In represent different dimensions of the tensor, such as the number of link sections, the number of days in different weeks, the number of time intervals, and other dimensions. The dynamic tensors X˜∈ℝI1×…×H×…×In can be extracted from the tensor stream with the sliding time window set as H. Note that X˜∈ℝI1×…×H×…×In contains the traffic speeds to be estimated with the prediction horizon set as P and 1≤P≤H.IfIi represents the sliding time window of the dynamic tensor, the value of the Ii can be represented as H, which includes the traffic speeds of the time intervals that need to be estimated. Assume P defines the estimation horizon and 1≤P≤H; therefore, the state estimation can be written as follows:(3)y¯In×P=fX˜I1×…×H×…×In,where y¯ represents the traffic flow data to be estimated. f. denotes the estimation model.Figure3 shows the example of the dynamic tensor extracted from the tensor stream with three dimensions, where I1 represents the periods, I2 represents the number of the research link sections, and I3 represents the number of days in different weeks. In addition, Figure 3 indicates two cases including the one-step-ahead prediction and multistep-ahead estimation, respectively. Note that the iterated strategy indicated by Zhan et al. [55], which takes the estimated value as the input, was utilized to realize multistep ahead estimation.Figure 3
Example of the dynamic tensor with traffic speeds to be estimated. (a) One-step ahead estimation; (b) multistep ahead estimation.
(a)(b)


### 4.2. Tensor-Based Bayesian Probabilistic CP Decomposition

This section introduces the Bayesian probabilistic CP decomposition utilized to produce the predicted value in a dynamic tensorX˜. Assume X˜ is a 3rd-order tensor and according to the definition of the CP decomposition, we have the following:(4)X˜=∑r=1Rar∘br∘cr,where ar, br, and cr represent the r-th row of the factor matrix A∈ℝI×R, B∈ℝJ×R, and C∈ℝK×R.Suppose that the noise term of the measured entryp∈Po in the approximation obeys independent Gaussian distribution as follows:(5)xp∼Nx^p,σ−1,where N. stands for the Gaussian distribution and σ is the precision item which is equal to the inverse of the covariance. Note that σ is a universal parameter for all elements.To construct model on the tensor data adequately, flexible prior distributions are placed over both the precision itemσ and the factor matrices. To be specific, the prior distributions over the row vectors in all factor matrices are assumed to obey multivariate Gaussians.(6)ai∼Nμa,Λa−1,i=1,2,…,I,bj∼Nμb,Λb−1,j=1,2,…,J,ck∼Nμc,Λc−1,k=1,2,…,K.The key concept of the fully Bayesian scheme is to treat the hyperparameters includingσ, θa≡μa,Λa, θb≡μb,Λb, and θc≡μc,Λc as random variables. According to the related work done by Salakhutdinov and Mnih [56], Tang et al. [54], and Chen et al. [52], conjugate Gaussian–Wishart priors can be set on the hyperparameters μa,μb,μc∈ℝR×1 and Λa,Λb,Λc∈ℝR×R as follows:(7)pθa∼Nμa,β0Λa−1×WΛa|W0,v0,pθb∼Nμb,β0Λb−1×WΛb|W0,v0,pθc∼Nμc,β0Λc−1×WΛc|W0,v0,where G. is a Gamma distribution. W. represents a Wishart distribution with v0 degrees of freedom and a R×R scale matrix W0. W. can be written as follows:(8)WΛk|W0,v0=1CΛkv0−R−1/2exp−12trW0−1Λk,where tr. defines the trace function of a square matrix, which is the sum of all elements on its main diagonal.Next, the precision itemσ in (5) needs to be estimated. Under the assumption of Gaussian distribution, the parameters reflect the noise level. Under the scenario of urban traffic state estimation, the data is constantly updated with time, so the precision is unknown, and it is unable to be completely captured by the reciprocal of the variance of all historical data. To improve the robustness of the model, the conjugate gamma distribution prior G. is set for the precision item and it can be expressed as follows:(9)σ∼GW˜0,v˜0,where W˜0 and v˜0 represent the shape parameter and the rate parameter, respectively.And we have the following:(10)pσ∼GW˜0,v˜0=v˜0W˜0σW˜0−1exp−v˜0σΓW˜0.In this way, the distribution of the traffic speeds to be estimated inX˜ can be obtained by the Bayesian inference algorithm as follows:(11)px^p|X˜=∫px^p|ai,bj,ck,σpA,B,C,σ,θa,θb,θc|X˜dA,B,C,σ,θa,θb,θc,p∈PeFigure4 indicates the graphical model which describes the generation procedure of the Bayesian probabilistic CP decomposition. Note that μ0, v˜0, W˜0, v0, and W0 are hyperparameters that should be given in advance.Figure 4
Graphical model for the DTBPD approach with 3rd-order tensor.Algorithm 1: Gibbs sampling for the DTBPD approach.
Initialize model parameterA1,B1,C1Forn = 1,2, …, NSample the hyper-parameterθa,θb,θc,σ,respectivelyσn:pσn|An,Bn,Cn,X˜θa:pθa|Anθb:pθb|Bnθc:pθc|CnFor eachi=1,2,...,I, sample the time feature in parallel:ain+1:pai|Bn,Cn,θa,σn,X˜For eachj=1,2,...,J, sample the link section feature in parallel:bjn+1:pbj|An,Cn,θb,σn,X˜For eachk=1,2,...,K, sample the days in parallel:ckn+1:pck|An,Bn,θc,σn,X˜


### 4.3. Markov Chain Monte Carlo Model

Considering the distribution of the speeds in the near future by (11) is a multidimensional integral, numerical methods can be applied to solve this issue. By treating px^p|X˜ as the expectation of px^p|A,B,C,σ over the posterior distribution pA,B,C,θa,θb,θc,σ|X˜, px^p|X˜ can be estimated by averaging the samples from this posterior distribution. To sample from the complicated posterior distribution that is hard to sample directly, a novel Gibbs sampling algorithm is provided to perform inference on the graphical model. Gibbs sampling algorithm is a widely used Markov Chain Monte Carlo-based approach for Bayesian inference. According to the computation details of conditional distribution discussed in reference [52, 54, 57], an efficient Gibbs sampling algorithm is summarized in Algorithm 1.By running the Gibbs sampling algorithm several times under a stationary state, the estimation traffic speeds can be written as follows:(12)px^p|X˜=1M∑t=1MN∑r=1Rairtbjrtckrt,σt−1,where X˜ represents measured dynamic tensor. x^p is an entry to be predicted and M is the number of iteration. ajrt is the i,r entry in the factor matrix A during the t−th iteration. bjrt is the i,r entry in the factor matrix B during the t−th iteration. ckrt is the i,r entry in the factor matrix C during the t−th iteration. σt−1 defines precision item during the t−th iteration.


## 4.1. Problem Statement

Road network speed estimation is to predict the traffic speed in the future by using the speed data of the existing historical time.DefineX¯∈ℝI1×I2×…×In as the nth-order tensor flow represented by road network speed data. I1,…,In represent different dimensions of the tensor, such as the number of link sections, the number of days in different weeks, the number of time intervals, and other dimensions. The dynamic tensors X˜∈ℝI1×…×H×…×In can be extracted from the tensor stream with the sliding time window set as H. Note that X˜∈ℝI1×…×H×…×In contains the traffic speeds to be estimated with the prediction horizon set as P and 1≤P≤H.IfIi represents the sliding time window of the dynamic tensor, the value of the Ii can be represented as H, which includes the traffic speeds of the time intervals that need to be estimated. Assume P defines the estimation horizon and 1≤P≤H; therefore, the state estimation can be written as follows:(3)y¯In×P=fX˜I1×…×H×…×In,where y¯ represents the traffic flow data to be estimated. f. denotes the estimation model.Figure3 shows the example of the dynamic tensor extracted from the tensor stream with three dimensions, where I1 represents the periods, I2 represents the number of the research link sections, and I3 represents the number of days in different weeks. In addition, Figure 3 indicates two cases including the one-step-ahead prediction and multistep-ahead estimation, respectively. Note that the iterated strategy indicated by Zhan et al. [55], which takes the estimated value as the input, was utilized to realize multistep ahead estimation.Figure 3
Example of the dynamic tensor with traffic speeds to be estimated. (a) One-step ahead estimation; (b) multistep ahead estimation.
(a)(b)


## 4.2. Tensor-Based Bayesian Probabilistic CP Decomposition

This section introduces the Bayesian probabilistic CP decomposition utilized to produce the predicted value in a dynamic tensorX˜. Assume X˜ is a 3rd-order tensor and according to the definition of the CP decomposition, we have the following:(4)X˜=∑r=1Rar∘br∘cr,where ar, br, and cr represent the r-th row of the factor matrix A∈ℝI×R, B∈ℝJ×R, and C∈ℝK×R.Suppose that the noise term of the measured entryp∈Po in the approximation obeys independent Gaussian distribution as follows:(5)xp∼Nx^p,σ−1,where N. stands for the Gaussian distribution and σ is the precision item which is equal to the inverse of the covariance. Note that σ is a universal parameter for all elements.To construct model on the tensor data adequately, flexible prior distributions are placed over both the precision itemσ and the factor matrices. To be specific, the prior distributions over the row vectors in all factor matrices are assumed to obey multivariate Gaussians.(6)ai∼Nμa,Λa−1,i=1,2,…,I,bj∼Nμb,Λb−1,j=1,2,…,J,ck∼Nμc,Λc−1,k=1,2,…,K.The key concept of the fully Bayesian scheme is to treat the hyperparameters includingσ, θa≡μa,Λa, θb≡μb,Λb, and θc≡μc,Λc as random variables. According to the related work done by Salakhutdinov and Mnih [56], Tang et al. [54], and Chen et al. [52], conjugate Gaussian–Wishart priors can be set on the hyperparameters μa,μb,μc∈ℝR×1 and Λa,Λb,Λc∈ℝR×R as follows:(7)pθa∼Nμa,β0Λa−1×WΛa|W0,v0,pθb∼Nμb,β0Λb−1×WΛb|W0,v0,pθc∼Nμc,β0Λc−1×WΛc|W0,v0,where G. is a Gamma distribution. W. represents a Wishart distribution with v0 degrees of freedom and a R×R scale matrix W0. W. can be written as follows:(8)WΛk|W0,v0=1CΛkv0−R−1/2exp−12trW0−1Λk,where tr. defines the trace function of a square matrix, which is the sum of all elements on its main diagonal.Next, the precision itemσ in (5) needs to be estimated. Under the assumption of Gaussian distribution, the parameters reflect the noise level. Under the scenario of urban traffic state estimation, the data is constantly updated with time, so the precision is unknown, and it is unable to be completely captured by the reciprocal of the variance of all historical data. To improve the robustness of the model, the conjugate gamma distribution prior G. is set for the precision item and it can be expressed as follows:(9)σ∼GW˜0,v˜0,where W˜0 and v˜0 represent the shape parameter and the rate parameter, respectively.And we have the following:(10)pσ∼GW˜0,v˜0=v˜0W˜0σW˜0−1exp−v˜0σΓW˜0.In this way, the distribution of the traffic speeds to be estimated inX˜ can be obtained by the Bayesian inference algorithm as follows:(11)px^p|X˜=∫px^p|ai,bj,ck,σpA,B,C,σ,θa,θb,θc|X˜dA,B,C,σ,θa,θb,θc,p∈PeFigure4 indicates the graphical model which describes the generation procedure of the Bayesian probabilistic CP decomposition. Note that μ0, v˜0, W˜0, v0, and W0 are hyperparameters that should be given in advance.Figure 4
Graphical model for the DTBPD approach with 3rd-order tensor.Algorithm 1: Gibbs sampling for the DTBPD approach.
Initialize model parameterA1,B1,C1Forn = 1,2, …, NSample the hyper-parameterθa,θb,θc,σ,respectivelyσn:pσn|An,Bn,Cn,X˜θa:pθa|Anθb:pθb|Bnθc:pθc|CnFor eachi=1,2,...,I, sample the time feature in parallel:ain+1:pai|Bn,Cn,θa,σn,X˜For eachj=1,2,...,J, sample the link section feature in parallel:bjn+1:pbj|An,Cn,θb,σn,X˜For eachk=1,2,...,K, sample the days in parallel:ckn+1:pck|An,Bn,θc,σn,X˜


## 4.3. Markov Chain Monte Carlo Model

Considering the distribution of the speeds in the near future by (11) is a multidimensional integral, numerical methods can be applied to solve this issue. By treating px^p|X˜ as the expectation of px^p|A,B,C,σ over the posterior distribution pA,B,C,θa,θb,θc,σ|X˜, px^p|X˜ can be estimated by averaging the samples from this posterior distribution. To sample from the complicated posterior distribution that is hard to sample directly, a novel Gibbs sampling algorithm is provided to perform inference on the graphical model. Gibbs sampling algorithm is a widely used Markov Chain Monte Carlo-based approach for Bayesian inference. According to the computation details of conditional distribution discussed in reference [52, 54, 57], an efficient Gibbs sampling algorithm is summarized in Algorithm 1.By running the Gibbs sampling algorithm several times under a stationary state, the estimation traffic speeds can be written as follows:(12)px^p|X˜=1M∑t=1MN∑r=1Rairtbjrtckrt,σt−1,where X˜ represents measured dynamic tensor. x^p is an entry to be predicted and M is the number of iteration. ajrt is the i,r entry in the factor matrix A during the t−th iteration. bjrt is the i,r entry in the factor matrix B during the t−th iteration. ckrt is the i,r entry in the factor matrix C during the t−th iteration. σt−1 defines precision item during the t−th iteration.


## 5. Experiment

### 5.1. Trajectory Data Description and Preprocessing

The data used in this paper mainly include trajectory data and urban network data. The online car-hailing trajectory data of Xi’an provided by the Didi open project (https://outreach.didichuxing.com/research/opendata/) is employed to extract the trajectory data to capture the traffic speeds of the urban network. The network data were extracted from the open street map (OSM) to provide the map information of Xi’an city.Since the trajectory data set used has the advantages of the high sampling frequency, wide coverage, and high precision, it is suitable for representing the traffic state. The original online car-hailing trajectory data covers about 60 square kilometers range of Xi’an city from Nov 1 to Nov 30 in 2016. The attributes of original datasets include driver ID, order ID, timestamp, longitude, latitude, and description. The sampling interval of trajectory is 2∼4 seconds and the trajectory point can be mapped to the network.Figure5 illustrates the preprocessing of the original trajectory data, which can obtain the initial experiment datasets. As shown in Table 1, the initial experiment datasets include six attributes including the Driver_ID, Order_ID, Time Label, Longitude, Latitude, and Velocity.Figure 5
The preprocessing of the original trajectory data.Table 1
Examples of initial experimental datasets.
Driver_IDOrder_IDTime LabelLongitudeLatitudeVelocity0f8…3225d6…8912016/11/1 18:45:56108.942539634.266706125.280f8…3225d6…8912016/11/1 18:45:59108.942549634.266936030.620f8…3225d6…8912016/11/1 18:46:02108.942549634.267026011.970f8…3225d6…8912016/11/1 18:46:05108.942549534.267165918.630f8…3225d6…8912016/11/1 18:46:14108.942549534.267485815.970f8…3225d6…8912016/11/1 18:46:17108.942549534.267395811.97


### 5.2. Experiment Data and Analysis

To ensure the effectiveness of the experiment, we processed road network speed data for four weeks from Nov 1 to Nov 28 in 2016 as the experimental data. The data of the first 23 days were taken as historical data, and the data of the last 5 days were taken as testing data. Figure6 provides the research scope of the experiment. As shown in Figure 6, the research scope area includes 64 roads including types of expressways, arterial roads, and secondary roads. To ensure a sufficient number of vehicles at each time interval and avoid inaccuracy or missing data caused by too long time interval, the travel speeds of the online car-hailing vehicle were average at each research road with a time interval of 5 min and each day is divided into 288 time intervals.Figure 6
The research scope area.Figure7 provides the average number of online car-hailing orders within the research area during different time intervals in a day. Considering the insufficient number of online car-hailing may lead to the inaccurate acquisition of traffic conditions, we select the periods from 8:00 to 22:00 when the number of orders is relatively large and sufficient taxis are running in the range of the research networks.Figure 7
The average number of online car-hailing orders at time intervals in a day.Figure8 demonstrates the speed distribution of three different grades of roads in the study time range on a certain day. It can be seen from Figure 8 that in terms of speed distribution, the average speed of the expressway is the highest, and that of the secondary road is the lowest among the three types of roads, which is consistent with the functional design of the roads. In addition, the speeds of all roads decreased significantly during the period of 17:00 to 19:00 and the speeds of the expressways fluctuated most sharply among the three kinds of roads.Figure 8
Comparison of the average speeds of the three kinds of roads in a day.


### 5.3. Spatiotemporal Analysis of Urban Traffic Data

Urban traffic flow data are complex and related to spatiotemporal dependency. Organizing the multidimensional traffic flow data into an appropriate tensor pattern is of importance to improve the efficiency and robustness of the traffic state estimation. In this section, the Pearson correlation coefficient is utilized to analyze the spatiotemporal characteristics of urban traffic. Since the residents usually travel regularly and urban traffic data often have certain periodic similarities, Figure9 indicates the temporal dependency analysis of the urban roads from multiple perspectives. Based on the traffic speeds of a road link (ID = 63) during a day, Figure 9(a) illustrates that the traffic state of the same section varies greatly with the hours, indicating a shorter sliding time window may be suitable for dynamic tensor construction. As shown in Figure 9(b), the traffic state during days in a week shows a significant correlation with a correlation coefficient larger than 0.60. Meanwhile, Figures 9(c) and 9(d) demonstrate the high relevance of the traffic state among days in different weeks. As shown in Figures 9(c) and 9(d), these four days are all Thursday and the correlation coefficients among them are larger than 0.75. Hence, the dynamic tensor construction should consider more days with high relevance including the days in the same weeks and the days in different weeks.Figure 9
Temporal dependency analysis of the urban roads. (a) Correlation coefficient matrix of traffic state of different hours in a day; (b) correlation coefficient matrix of traffic state of different days in weeks; (c) speed scatter diagram of the Thursdays in different weeks; (d) correlation coefficient matrix of the Thursdays in different weeks.
(a)(b)(c)(d)Figure10 indicates the spatial dependency analysis of the urban network by using the traffic speeds series data of all road links in the research scope during a day. It can be found that the road link on the network demonstrates spatial correlation in different degrees due to the connectivity of the urban road network. In general, the road links present high relevance with their upstream road section, downstream sections, or adjacent sections. Hence, this paper selects the highly correlated road links to construct dynamic tensors.Figure 10
Spatial dependency analysis of the urban roads.


### 5.4. Baseline Model and Performance Indexes

To verify the effectiveness of the DTBPD model, several advanced deep learning-based models and tensor-based models are applied as the baseline models, including the LSTM [58], GRU [34], FDL [59], T-GCN [43], smooth PARAFAC tensor completion model (SPC) [60], HaLRTC [50], and BGCP model [52]. The parameters of the baseline models are indicated as follows:LSTM: To solve the long-term dependency of RNN, the LSTM structure was established whose memory block contains forget gate, the input gate, and the output gate. To reduce overfitting issues, the dropout rate was set as 0.1.GRU: As a variant of the LSTM with a simpler structure, the GRU model only combines the forget gate and the input gate of the LSTM into a single update gate. Besides, there is a reset gate in a hidden unit of the GRU.FDL: It is a combination model proposed by Gu et al. [59] and it fuses the LSTM and GRU layer, which can fully mine the spatiotemporal features with the selected input.T-GCN: T-GCN [43] integrates the graph convolutional network and gated recurrent units to model spatial dependence and temporal dependence, respectively. There is one GRU layer in the hidden layers of the T-GCN model.SPC: SPC is a smooth PARAFAC tensor-based completion model by combining the smooth PARAFAC decomposition and the efficient selection of models to minimize the tensor rank. Quadratic variation is employed as a strategy with parameter ρ chosen as [0.3 0.3 0.3].HaLRTC: It is a high accuracy low-rank tensor completion approach employed by Ran et al. [50]. The parameter α is set as [1/3, 1/3, 1/3] and the parameter ρ is set as 0.01.BGCP: It is a Bayesian decomposition-based tensor proposed by Chen et al. [52], which extends the Bayesian matrix factorization [56] to a higher-order case to learn the underlying statistical patterns in spatiotemporal traffic data.In addition, the input time step of all the DL-based models is set as 5 and the input variable includes 64 link sections. For the LSTM, GRU, FDL, and T-GCN, the hidden units in hidden layers are chosen as 200 and the epochs are all set as 200 with the batch size set as 64. To test the models fairly, the optimizer of three DL-based models is chosen as the Adam. For the tensor-based model, the input tensor contains the historical data of all road sections during the days in the week and the same days in the previous 4 weeks, indicating the dynamic tensors’ dimension of the days and road sections 11 and 64, respectively. The low rank of the DTBPD algorithm is set as 30 and the MCMC-based sampling algorithm is run for 500 iterations. Note that the data of the first 23 days are utilized for training the DL-based model with the data of the last 5 days for testing these models.To test the performance of the DTBPD approaches and compare it to the baseline models, the mean absolute percentage error (MAPE) and root mean square error (RMSE) were used to analyze the experimental results.(13)MAPE=1k∑n=1kφ⌢k−φkφk×100%,RMSE=1k∑n=1kφ⌢k−φk2,where φ⌢k represents the estimated speed value and φk represents the ground-truth value. k is the number of testing speed data.We utilize computer with Intel(R) Core(TM) i7-11800H CPU @ 4.6 GHz and 32 GB memory to conduct the experiment. Python 3.68 with TensorFlow 2.0 and Keras 2.0 is employed to implement the proposed model and baseline models.


## 5.1. Trajectory Data Description and Preprocessing

The data used in this paper mainly include trajectory data and urban network data. The online car-hailing trajectory data of Xi’an provided by the Didi open project (https://outreach.didichuxing.com/research/opendata/) is employed to extract the trajectory data to capture the traffic speeds of the urban network. The network data were extracted from the open street map (OSM) to provide the map information of Xi’an city.Since the trajectory data set used has the advantages of the high sampling frequency, wide coverage, and high precision, it is suitable for representing the traffic state. The original online car-hailing trajectory data covers about 60 square kilometers range of Xi’an city from Nov 1 to Nov 30 in 2016. The attributes of original datasets include driver ID, order ID, timestamp, longitude, latitude, and description. The sampling interval of trajectory is 2∼4 seconds and the trajectory point can be mapped to the network.Figure5 illustrates the preprocessing of the original trajectory data, which can obtain the initial experiment datasets. As shown in Table 1, the initial experiment datasets include six attributes including the Driver_ID, Order_ID, Time Label, Longitude, Latitude, and Velocity.Figure 5
The preprocessing of the original trajectory data.Table 1
Examples of initial experimental datasets.
Driver_IDOrder_IDTime LabelLongitudeLatitudeVelocity0f8…3225d6…8912016/11/1 18:45:56108.942539634.266706125.280f8…3225d6…8912016/11/1 18:45:59108.942549634.266936030.620f8…3225d6…8912016/11/1 18:46:02108.942549634.267026011.970f8…3225d6…8912016/11/1 18:46:05108.942549534.267165918.630f8…3225d6…8912016/11/1 18:46:14108.942549534.267485815.970f8…3225d6…8912016/11/1 18:46:17108.942549534.267395811.97


## 5.2. Experiment Data and Analysis

To ensure the effectiveness of the experiment, we processed road network speed data for four weeks from Nov 1 to Nov 28 in 2016 as the experimental data. The data of the first 23 days were taken as historical data, and the data of the last 5 days were taken as testing data. Figure6 provides the research scope of the experiment. As shown in Figure 6, the research scope area includes 64 roads including types of expressways, arterial roads, and secondary roads. To ensure a sufficient number of vehicles at each time interval and avoid inaccuracy or missing data caused by too long time interval, the travel speeds of the online car-hailing vehicle were average at each research road with a time interval of 5 min and each day is divided into 288 time intervals.Figure 6
The research scope area.Figure7 provides the average number of online car-hailing orders within the research area during different time intervals in a day. Considering the insufficient number of online car-hailing may lead to the inaccurate acquisition of traffic conditions, we select the periods from 8:00 to 22:00 when the number of orders is relatively large and sufficient taxis are running in the range of the research networks.Figure 7
The average number of online car-hailing orders at time intervals in a day.Figure8 demonstrates the speed distribution of three different grades of roads in the study time range on a certain day. It can be seen from Figure 8 that in terms of speed distribution, the average speed of the expressway is the highest, and that of the secondary road is the lowest among the three types of roads, which is consistent with the functional design of the roads. In addition, the speeds of all roads decreased significantly during the period of 17:00 to 19:00 and the speeds of the expressways fluctuated most sharply among the three kinds of roads.Figure 8
Comparison of the average speeds of the three kinds of roads in a day.


## 5.3. Spatiotemporal Analysis of Urban Traffic Data

Urban traffic flow data are complex and related to spatiotemporal dependency. Organizing the multidimensional traffic flow data into an appropriate tensor pattern is of importance to improve the efficiency and robustness of the traffic state estimation. In this section, the Pearson correlation coefficient is utilized to analyze the spatiotemporal characteristics of urban traffic. Since the residents usually travel regularly and urban traffic data often have certain periodic similarities, Figure9 indicates the temporal dependency analysis of the urban roads from multiple perspectives. Based on the traffic speeds of a road link (ID = 63) during a day, Figure 9(a) illustrates that the traffic state of the same section varies greatly with the hours, indicating a shorter sliding time window may be suitable for dynamic tensor construction. As shown in Figure 9(b), the traffic state during days in a week shows a significant correlation with a correlation coefficient larger than 0.60. Meanwhile, Figures 9(c) and 9(d) demonstrate the high relevance of the traffic state among days in different weeks. As shown in Figures 9(c) and 9(d), these four days are all Thursday and the correlation coefficients among them are larger than 0.75. Hence, the dynamic tensor construction should consider more days with high relevance including the days in the same weeks and the days in different weeks.Figure 9
Temporal dependency analysis of the urban roads. (a) Correlation coefficient matrix of traffic state of different hours in a day; (b) correlation coefficient matrix of traffic state of different days in weeks; (c) speed scatter diagram of the Thursdays in different weeks; (d) correlation coefficient matrix of the Thursdays in different weeks.
(a)(b)(c)(d)Figure10 indicates the spatial dependency analysis of the urban network by using the traffic speeds series data of all road links in the research scope during a day. It can be found that the road link on the network demonstrates spatial correlation in different degrees due to the connectivity of the urban road network. In general, the road links present high relevance with their upstream road section, downstream sections, or adjacent sections. Hence, this paper selects the highly correlated road links to construct dynamic tensors.Figure 10
Spatial dependency analysis of the urban roads.


## 5.4. Baseline Model and Performance Indexes

To verify the effectiveness of the DTBPD model, several advanced deep learning-based models and tensor-based models are applied as the baseline models, including the LSTM [58], GRU [34], FDL [59], T-GCN [43], smooth PARAFAC tensor completion model (SPC) [60], HaLRTC [50], and BGCP model [52]. The parameters of the baseline models are indicated as follows:LSTM: To solve the long-term dependency of RNN, the LSTM structure was established whose memory block contains forget gate, the input gate, and the output gate. To reduce overfitting issues, the dropout rate was set as 0.1.GRU: As a variant of the LSTM with a simpler structure, the GRU model only combines the forget gate and the input gate of the LSTM into a single update gate. Besides, there is a reset gate in a hidden unit of the GRU.FDL: It is a combination model proposed by Gu et al. [59] and it fuses the LSTM and GRU layer, which can fully mine the spatiotemporal features with the selected input.T-GCN: T-GCN [43] integrates the graph convolutional network and gated recurrent units to model spatial dependence and temporal dependence, respectively. There is one GRU layer in the hidden layers of the T-GCN model.SPC: SPC is a smooth PARAFAC tensor-based completion model by combining the smooth PARAFAC decomposition and the efficient selection of models to minimize the tensor rank. Quadratic variation is employed as a strategy with parameter ρ chosen as [0.3 0.3 0.3].HaLRTC: It is a high accuracy low-rank tensor completion approach employed by Ran et al. [50]. The parameter α is set as [1/3, 1/3, 1/3] and the parameter ρ is set as 0.01.BGCP: It is a Bayesian decomposition-based tensor proposed by Chen et al. [52], which extends the Bayesian matrix factorization [56] to a higher-order case to learn the underlying statistical patterns in spatiotemporal traffic data.In addition, the input time step of all the DL-based models is set as 5 and the input variable includes 64 link sections. For the LSTM, GRU, FDL, and T-GCN, the hidden units in hidden layers are chosen as 200 and the epochs are all set as 200 with the batch size set as 64. To test the models fairly, the optimizer of three DL-based models is chosen as the Adam. For the tensor-based model, the input tensor contains the historical data of all road sections during the days in the week and the same days in the previous 4 weeks, indicating the dynamic tensors’ dimension of the days and road sections 11 and 64, respectively. The low rank of the DTBPD algorithm is set as 30 and the MCMC-based sampling algorithm is run for 500 iterations. Note that the data of the first 23 days are utilized for training the DL-based model with the data of the last 5 days for testing these models.To test the performance of the DTBPD approaches and compare it to the baseline models, the mean absolute percentage error (MAPE) and root mean square error (RMSE) were used to analyze the experimental results.(13)MAPE=1k∑n=1kφ⌢k−φkφk×100%,RMSE=1k∑n=1kφ⌢k−φk2,where φ⌢k represents the estimated speed value and φk represents the ground-truth value. k is the number of testing speed data.We utilize computer with Intel(R) Core(TM) i7-11800H CPU @ 4.6 GHz and 32 GB memory to conduct the experiment. Python 3.68 with TensorFlow 2.0 and Keras 2.0 is employed to implement the proposed model and baseline models.


## 6. Result and Discussion

### 6.1. Comparison of the DTBPD Approaches with Different Parameters

In this section, we test the DTBPD models by tuning up the low rank and the sliding time window, which are the two critical parameters of the DTBPD approach. We select the low rank from [5, 15, 30, 50, 100]. The sliding time windows are chosen from the set [6, 12, 24, 36, 48], which corresponds to the time of [0.5 h, 1 h, 2 h, 3 h, 4 h]. It can be learned from Figure9, the MAPE and RMSE of the DTBPD model decrease with the increase of the low rank. As shown in Figure 11, the RMSE does not improve obviously with a large low rank. Hence, we set the low rank of the DTBPD as 30. In addition, the performance of the proposed model improves firstly and then drops with the increase of the sliding time window. This may be because the temporal feature of the traffic speed may drop if the distance between the historical data and the speed to be forecasted becomes larger, which may introduce more invalid temporal information and affect the performance of the DTBPD model. Since the proposed model can mine the characteristics of the traffic flow effectively, the sliding time window can be set as 12 which is most efficient for estimating traffic state in the future.Figure 11
Comparison of the DTBPD model with different parameters. (a) MAPE; (b) RMSE.
(a)(b)Figure12 demonstrates the average MAPE and RMSE values of the DTBPD model at each time interval under different sliding time windows. It can be observed from Figure 10 that estimation errors of the starting period of the day are larger than those of other periods, which may be due to the composition of tensors considering the discontinuous traffic flow from the previous day. Figure 12 reveals that change trends of MAPE and RMSE are similar under different sliding time windows, indicating that the model is stable for different data ranges.Figure 12
Average estimation speed of different time intervals with different sliding time windows. (a) MAPE; (b) RMSE.
(a)(b)


### 6.2. Performance Comparison of the Different Models

This section compares the overall performance of the DTBPD model with the baselines by taking the five-day estimation results as a whole. Tables2 and 3 provide the MAPEs and RMSEs of the model at different types of roads. To be specific, the estimation error of all models at the expressways is little larger than those of the arterial road and secondary road. This may be since the values of the traffic speeds at expressways are relatively larger than those of the arterial roads and secondary roads, and the fluctuation of the traffic speeds at expressways are more violent. From the performance of the different models, it can be learned from Tables 2 and 3, the DTBPD outperforms the DL-based models and the tensor-based models, with improvements of 7.49% and 9.25% on MAPE and RMSE compared with those of the T-GCN model, which is the best DL-based predictor among the models. Since the T-GCN model combines the GCN and the GRU model, it shows better performance in learning the spatiotemporal characteristics than RNN-based models including the LSTM, GRU, and FDL. Meanwhile, the SPC and HaLRTC model also provides accurate and stable performance at the expressway and arterial road compared with the LSTM and GRU. Besides, the DTBPD model comes best among these models, which outperforms the BGCP model with improvements of 6.68% and 7.34% on MAPE and RMSE, respectively. Since the proposed model utilizes the dynamic input structure and Bayesian probabilistic CP decomposition, the traffic feature with high dependency can be organized and mined in the tensor structure constantly. With the efficient decomposition approach, the calibrated factor matrices are capable of estimating the missing values in the dynamic tensor accurately.Table 2
The overall performance of different models in terms of MAPE (%).
ModelsDifferent types of roadsExpresswayArtertial roadSecondary roadTotalLSTM13.8713.7213.3213.64GRU13.5413.0312.8813.16FDL13.0412.9812.5812.88T-GCN12.8212.7112.4412.69SPC13.8513.6713.4513.65HaLRTC13.9313.8113.4913.78BGCP12.7712.7812.0312.58DTBPD11.8611.8311.5111.74Table 3
The overall performance of different models in terms of RMSE.
ModelsDifferent types of roadsExpresswayArtertial roadSecondary roadTotalLSTM3.423.293.133.32GRU3.263.183.123.19FDL3.193.133.033.12T-GCN3.032.992.822.92SPC3.363.253.023.20HaLRTC3.463.233.113.26BGCP2.922.942.742.86DTBPD2.732.762.402.65Figure13 gives the performance comparison between the ground-truth data and estimated data under the single-step-ahead estimation horizons. From the heat map, it is observed that the DTBPD model has a very good fitness under normal and abnormal scenarios at different link sections. Note that even during the peak period when the traffic speed fluctuates significantly, the DTBPD can still estimate the traffic speed accurately. Meanwhile, even in different types of link sections where the traffic state presents differentiated features, the DTBPD model is capable of presenting similar estimation performance by using the dynamic tenor to consider the relative temporal characteristics and using the Gibbs sampling approach to approximate the factor matrix of the tensor.Figure 13
Comparison between the ground-truth and estimated data during the 5 days. (a) Ground-truth data; (b) estimated data.
(a)(b)Table4 demonstrates the time consumption of the DTBPD model and the DL-based models. Since the DTBPD model needs to estimate the parameters of the model at each step, Table 4 provides its average time consumption for a single step. For the DL-based model, the update parameter in the model structure needs to train it with historical data, which spends much more time than the DTBPD model. Hence, compared with the DL-based models, the simple structure of the proposed model only needs a few seconds to calibrate the model, which is flexible and time-saving. In addition, the proposed model can adjust the composition of tensor data dynamically by using the sliding time window, which may protect the model from abnormal data and make the model robust.Table 4
Comparison of time consumption between the DTBPD model and DL-based models.
ModelTraining time consumption or calibration time consumption (s)LSTM380.35GRU310.40FDL774.08T-GCN823.31DTBPD2.49


### 6.3. Comparison of Different Models with Longer Estimation Horizons

Figure14 provides the comparison of the different models with the extension of the estimation horizon from 5 mins to 30 mins. As shown in Figure 14, the MAPE and RMSE of different models rise slightly with the increase of the estimation horizon. Note that the DTBPD model still indicates obvious advantages over the LSTM, GRU, FDL, T-GCN, SPC, HaLRTC, and BGCP models when the estimation horizon P = 6, which means that this tensor-based model can efficiently infer the evolution trend of the traffic state.Figure 14
Comparison of different models with longer estimation horizons. (a) MAPE; (b) RMSE.
(a)(b)Figure15 provides the distributions of the MAPE and the RMSE estimated by the BTBPD approach with the 5-day dataset. As indicated in Figure 15, the errors of the proposed model are generally normal distribution. When the number of the estimation horizon increases from 2 to 6, the fitting curve moves to the right gradually and the prediction error gradually increases. This may be because the more step to estimate, the more estimated values in the historical data may enlarge the estimated error [55].Figure 15
The error distribution of the DTBPD model with the increase of the estimation horizon. (a) MAPE; (b) RMSE.
(a)(b)


## 6.1. Comparison of the DTBPD Approaches with Different Parameters

In this section, we test the DTBPD models by tuning up the low rank and the sliding time window, which are the two critical parameters of the DTBPD approach. We select the low rank from [5, 15, 30, 50, 100]. The sliding time windows are chosen from the set [6, 12, 24, 36, 48], which corresponds to the time of [0.5 h, 1 h, 2 h, 3 h, 4 h]. It can be learned from Figure9, the MAPE and RMSE of the DTBPD model decrease with the increase of the low rank. As shown in Figure 11, the RMSE does not improve obviously with a large low rank. Hence, we set the low rank of the DTBPD as 30. In addition, the performance of the proposed model improves firstly and then drops with the increase of the sliding time window. This may be because the temporal feature of the traffic speed may drop if the distance between the historical data and the speed to be forecasted becomes larger, which may introduce more invalid temporal information and affect the performance of the DTBPD model. Since the proposed model can mine the characteristics of the traffic flow effectively, the sliding time window can be set as 12 which is most efficient for estimating traffic state in the future.Figure 11
Comparison of the DTBPD model with different parameters. (a) MAPE; (b) RMSE.
(a)(b)Figure12 demonstrates the average MAPE and RMSE values of the DTBPD model at each time interval under different sliding time windows. It can be observed from Figure 10 that estimation errors of the starting period of the day are larger than those of other periods, which may be due to the composition of tensors considering the discontinuous traffic flow from the previous day. Figure 12 reveals that change trends of MAPE and RMSE are similar under different sliding time windows, indicating that the model is stable for different data ranges.Figure 12
Average estimation speed of different time intervals with different sliding time windows. (a) MAPE; (b) RMSE.
(a)(b)


## 6.2. Performance Comparison of the Different Models

This section compares the overall performance of the DTBPD model with the baselines by taking the five-day estimation results as a whole. Tables2 and 3 provide the MAPEs and RMSEs of the model at different types of roads. To be specific, the estimation error of all models at the expressways is little larger than those of the arterial road and secondary road. This may be since the values of the traffic speeds at expressways are relatively larger than those of the arterial roads and secondary roads, and the fluctuation of the traffic speeds at expressways are more violent. From the performance of the different models, it can be learned from Tables 2 and 3, the DTBPD outperforms the DL-based models and the tensor-based models, with improvements of 7.49% and 9.25% on MAPE and RMSE compared with those of the T-GCN model, which is the best DL-based predictor among the models. Since the T-GCN model combines the GCN and the GRU model, it shows better performance in learning the spatiotemporal characteristics than RNN-based models including the LSTM, GRU, and FDL. Meanwhile, the SPC and HaLRTC model also provides accurate and stable performance at the expressway and arterial road compared with the LSTM and GRU. Besides, the DTBPD model comes best among these models, which outperforms the BGCP model with improvements of 6.68% and 7.34% on MAPE and RMSE, respectively. Since the proposed model utilizes the dynamic input structure and Bayesian probabilistic CP decomposition, the traffic feature with high dependency can be organized and mined in the tensor structure constantly. With the efficient decomposition approach, the calibrated factor matrices are capable of estimating the missing values in the dynamic tensor accurately.Table 2
The overall performance of different models in terms of MAPE (%).
ModelsDifferent types of roadsExpresswayArtertial roadSecondary roadTotalLSTM13.8713.7213.3213.64GRU13.5413.0312.8813.16FDL13.0412.9812.5812.88T-GCN12.8212.7112.4412.69SPC13.8513.6713.4513.65HaLRTC13.9313.8113.4913.78BGCP12.7712.7812.0312.58DTBPD11.8611.8311.5111.74Table 3
The overall performance of different models in terms of RMSE.
ModelsDifferent types of roadsExpresswayArtertial roadSecondary roadTotalLSTM3.423.293.133.32GRU3.263.183.123.19FDL3.193.133.033.12T-GCN3.032.992.822.92SPC3.363.253.023.20HaLRTC3.463.233.113.26BGCP2.922.942.742.86DTBPD2.732.762.402.65Figure13 gives the performance comparison between the ground-truth data and estimated data under the single-step-ahead estimation horizons. From the heat map, it is observed that the DTBPD model has a very good fitness under normal and abnormal scenarios at different link sections. Note that even during the peak period when the traffic speed fluctuates significantly, the DTBPD can still estimate the traffic speed accurately. Meanwhile, even in different types of link sections where the traffic state presents differentiated features, the DTBPD model is capable of presenting similar estimation performance by using the dynamic tenor to consider the relative temporal characteristics and using the Gibbs sampling approach to approximate the factor matrix of the tensor.Figure 13
Comparison between the ground-truth and estimated data during the 5 days. (a) Ground-truth data; (b) estimated data.
(a)(b)Table4 demonstrates the time consumption of the DTBPD model and the DL-based models. Since the DTBPD model needs to estimate the parameters of the model at each step, Table 4 provides its average time consumption for a single step. For the DL-based model, the update parameter in the model structure needs to train it with historical data, which spends much more time than the DTBPD model. Hence, compared with the DL-based models, the simple structure of the proposed model only needs a few seconds to calibrate the model, which is flexible and time-saving. In addition, the proposed model can adjust the composition of tensor data dynamically by using the sliding time window, which may protect the model from abnormal data and make the model robust.Table 4
Comparison of time consumption between the DTBPD model and DL-based models.
ModelTraining time consumption or calibration time consumption (s)LSTM380.35GRU310.40FDL774.08T-GCN823.31DTBPD2.49


## 6.3. Comparison of Different Models with Longer Estimation Horizons

Figure14 provides the comparison of the different models with the extension of the estimation horizon from 5 mins to 30 mins. As shown in Figure 14, the MAPE and RMSE of different models rise slightly with the increase of the estimation horizon. Note that the DTBPD model still indicates obvious advantages over the LSTM, GRU, FDL, T-GCN, SPC, HaLRTC, and BGCP models when the estimation horizon P = 6, which means that this tensor-based model can efficiently infer the evolution trend of the traffic state.Figure 14
Comparison of different models with longer estimation horizons. (a) MAPE; (b) RMSE.
(a)(b)Figure15 provides the distributions of the MAPE and the RMSE estimated by the BTBPD approach with the 5-day dataset. As indicated in Figure 15, the errors of the proposed model are generally normal distribution. When the number of the estimation horizon increases from 2 to 6, the fitting curve moves to the right gradually and the prediction error gradually increases. This may be because the more step to estimate, the more estimated values in the historical data may enlarge the estimated error [55].Figure 15
The error distribution of the DTBPD model with the increase of the estimation horizon. (a) MAPE; (b) RMSE.
(a)(b)


## 7. Conclusion

Massive online car-hailing trajectory data have become a popular and significant source for analyzing the urban traffic status, which is fundamental for reducing traffic congestion and constructing smart cities. This paper proposes a dynamic tensor-based Bayesian probabilistic decomposition approach for urban traffic state estimation. Firstly, the urban traffic speed data are formed into the dynamic tensor mode to fully mine the spatiotemporal characteristics of the traffic state. Secondly, the Bayesian probabilistic decomposition approach is introduced to decompose the tensor with speed to be estimated into a product of several vectors. Thirdly, the Gibbs sampling algorithm is proposed to calibrate the parameter of the proposed DBTPD models. Finally, the urban traffic speed data were extracted from the online car-hailing trajectory data of Didi Company to examine the accuracy and robustness of the DBTPD model.Some findings can be summarized as follows. (1) The DBTPD model can well capture the spatiotemporal characteristics of the urban traffic state with a sliding sampling structure and Bayesian probabilistic decomposition approach. (2) The proposed outperforms the benchmark model including the LSTM, GRU, FDL, T-GCN, SPC, HaLRTC, and BGCP model in terms of the one-step-ahead estimation and multistep-ahead estimation. (3) The calibration time consumption of the DBTPD model is much less than those of the DL-based model, which indicates the proposed model is practical.Some further research areas should be investigated. On the one hand, multisource data such as geographic information data or pedestrian flow data can be introduced to improve the accuracy of data estimation. On the other hand, the Bayesian probabilistic decomposition approach can be applied to multidimensional tensors, which consider more spatiotemporal characteristics for enhancing the robustness of the DBTPD model.



---

*Source: 1793060-2022-04-26.xml*