# Bayesian Dynamic Linear Model with Adaptive Parameter Estimation for Short-Term Travel Speed Prediction

Authors: Tai-Yu Ma; Yoann Pigné
Journal: Journal of Advanced Transportation
 (2019)

---

## Abstract

Bayesian dynamic linear model is a promising method for time series data analysis and short-term forecasting. One research issue concerns how the predictive model adapts to changes in the system, especially when shocks impact system behavior. In this study, we propose an adaptive dynamic linear model to adaptively update model parameters for online system state prediction. The proposed method is an automatic approach based on the feedback of prediction errors at each time slot without the needs of external intervention. The experimental study on short-term travel speed prediction shows that the proposed method can significantly reduce the prediction errors of the traditional dynamic linear model and outperform two state-of-the-art methods in the case of major system behavior changes.


---

## Body

## 1. Introduction

Accurate short-term traffic prediction plays an important role for successful traffic information system application such as en-route navigation system, traffic control, and traffic congestion management [1]. During past decades, different prediction methods have been proposed to predict traffic states for developing effective traveler information system and real-time traffic management. The methodology for short-term travel time/traffic flow prediction can be classified into the data-driven approach and model-driven approach [2–5]. The model-driven approach consists in applying traffic flow theory to inference traffic state dynamics based on partial observation of traffic data [6–10]. The advantage of the model-driven approach is that it can obtain accurate traffic state estimation with fewer observations. However, the performance of the model-driven approach can be poor if the applied models are not well calibrated [4]. As regards the data-driven approach, it relies on the spatial-temporal correlation of traffic states for which future traffic states can be estimated based on historical time series data. Among different data-driven approaches, which are the focus of this study, machine learning methods are widely used for traffic characteristics prediction, e.g., neural networks [11, 12], autoregressive integrated moving average models (ARIMA) [13, 14], support vector machine methods [15], nearest neighbor classification methods [16, 17], ensemble learning approach [12], and Bayesian dynamic linear models (DLM)/state space models [18–22], among many others. One of the main issues in short-term traffic prediction is how to dynamically adapt a predicting model to the uncertainty of system behavior changes, in particular in case of accident or unforeseen events. With recent vehicular communication advances in real-time traffic data collection, the development of adaptive short-term traffic prediction methods become an active research area in transportation science and in developing applications based on vehicular communication technology.In this perspective, the DLM approach provides a systematic approach based on Bayes’ theorem for system states updating and prediction. This approach considers system states of interest as unknown stochastic variables to be estimated. The prior distribution of system states is quantified based on historical data. By collecting new data over time, the posterior distribution of system states can be estimated based on the Bayes’ theorem. This sequential learning framework provides an adaptive learning process for handling time series data prediction. It has been shown that model parameters need to be adaptive with system behavior [23]. Fei et al. [19] proposed a DLM for real-time short-term freeway travel time prediction. The model adjusts the variances of disturbance under a user-defined threshold based on the adaptive control theory. However, such an adjustment mechanism is not optimized and relies on the intervention of expert knowledge, raising issues in its generalization in different areas. For this issue, Fei et al. [18] incorporated a Markov switching process in the DLM based on the three-phase traffic flow theory. They showed the Markov switching DLM approach outperforms the ARIMA method.Another adaptive modeling approach consists in developing methodology to detect change points of system states and update system parameters to catch system behavior changes [24–29]. The change-point detection methods can be designed to monitor prediction errors and detect accidents, providing feedback to adjust model prediction and reduce prediction errors. Comert and Bezuglov [25] applied the hidden Markov model (HMM) and the expectation-maximization (EM) algorithm as a change-point detection method to update the estimation of parameters (i.e., process mean) used in the autoregressive integrated moving average (ARIMA) model. Moreira-Matias and Alesiani [28] proposed a change detection method based on Page-Hinkley change-point detection method [30] for triggering an accident alarm. The threshold for alarm triggering is a user-defined deterministic parameter, corresponding to a tolerable false alarm rate.In this study, a new online adaptive parameter estimation approach is proposed under the DLM framework to achieve better accuracy of prediction when some external events or system regime changes occur. This method is based on continuously monitoring prediction errors for adaptively adjusting model parameters. The main contribution resides on the adaptive model parameter adjustment design to improve classical DLM approach when unpredicted system behavior changes are detected. The performance of the proposed approach is tested on a simulated road network under accidental scenarios. The performance of the proposed method is compared with classical DLM methods and the benchmark methods, i.e., ARIMA method [31] and Holt-Winters Exponential Smoothing method [32]. Note that we do not intend to extensively compare the proposed approach with other methods, but instead to demonstrate the effectiveness of the proposed method in improving the parameter setting issues of classical DLM approaches.The rest of the paper is organized as follows. In Section2, we present the general DLM forecasting framework and different DLM specifications for time series data analysis. In Section 3, a new adaptive parameter estimation method is proposed for online parameter learning to reduce prediction error. Section 4 reports the numerical study on real-time short-term road travel speed prediction under accidental scenarios. A comparative study with two other state-of-the-art methods is provided. Finally, conclusions are drawn and future extensions are discussed.


## 2. Bayesian Dynamic Linear Model for Traffic State Prediction

A general DLM can be described by an observation equation and a system state equation to model the process of a system [23]. The state equation describes system state evolution mapping from a priori distribution at t-1 to posterior distribution at time t. The observation equation describes observed measurements at time t in relation to system states. The evolution of system states over time is assumed to follow a stochastic process with Gaussian errors. A DLM can be written as [23] (1)xt=Gtxt-1+wt,wt~N0,Wtstateequation(2)yt=Ftxt+vt,vt~N0,VtobservationequationIn (1), xt is the system state at timet. Gt is the evolution matrix of xt. In (2), yt is observation at time t. Ft is the design matrix of xt. wt and vt are white noise error terms following normal distribution with 0 mean and variance Wt and Vt, respectively. It is assumed that vt and wt are mutually independent, i.e., covvt,wt=0 for t=1,…,T. The ratio wt/vt is called thesignal-to-noise ratio at time t. It represents the ratio of system prediction errors wt and observation errors vt. In general, Wt and Vt are unknown and need to be estimated from data. The general DLM can be represented by a quadruple Ft,Gt,Vt,Wt over time t=1,2,…,T. The DLM provides a probabilistic linkage to update the posterior distribution of system states based on a priori distribution and newly available observations over time based on the Bayesian forecasting framework [19, 23, 33]. The Bayesian forecasting framework in the context of traffic speed prediction on a road network is described as follows.


### 2.1. Bayesian Forecasting Framework

Step 1 (initialization).
Initialize system state variablesx0 (i.e., travel speed on a road section/link) at t=0. (3)x0∣D0~Nm0,C0,where m0 denotes the estimated means of link travel speed at t=0; C0 is the estimated variance based on the initial information set D0 (i.e., historical travel speed data on network). Set t=t0.Step 2 (prior distribution estimation).
Estimate the prior distribution ofxt as(4)xt∣Dt-1~Nat,Rtwithat=Gtmt-1andRt=GtCt-1Gt′+Wtwhere N(at,Rt) is the normal distribution. at is the estimated mean of system states, and Rt is the estimated variance of system states. We can observe that increasing Gt or Wt will amplify the variance of xt.Step 3 (one-step forecast).
Estimate one-step forecast foryt as(5)yt∣Dt-1~Nft,Qtwithft=Ft′atandQt=Ft′RtFt+Vtwhere ft is the mean of prediction at t and Qt is the variance of prediction at t. We can observed that if Ft (i.e., design matrix) is constant,ft∝at=Gtmt-1 and Qt∝Rt+Vt.Step 4 (posterior distribution att).
Calculate the posterior distributionxt∣Dt as(6)xt∣Dt~Nmt,Ctwithmt=at+AtetandCt=Rt-AtQtAt′where At=RtFtQt-1 and et=yt-ft. IfFt=1, then At=Rt/Qt.Step 5 (iterate).
Sett=t+1. If t=T then stop; otherwise go to Step 1.The proof of the one-step forecast and the posterior distribution can be found in [23]. Note that, for the univariate DLM, it has been shown that the covariance of system evolution Wt needs to adapt to drastic system behavior changes or regime shift [23]. Regardless of this issue will make a serious prediction bias [12]. However, none of the existing studies propose any adaptive parameter estimation for Wt to address this issue.We specify three DLMs, i.e., first-order DLM, cubic spline smoothing DLM, and second-order DLM with increasing complexity based on the above DLM forecasting framework for travel speed prediction on a road network. The aim is to provide the benchmarks to compare with the performance of the proposed adaptive parameter updating DLM. The three DLMs are described as follows.(a) First-Order DLM.This is the basic DLM which incorporates a mean level term and a Gaussian noisy term to describe system state evolution. (7)yt=μt+εobs,εt~N0,σobs2(8)μt=μt-1+εlevel,εlevel~N0,σlevel2(9)xt=μt,F=G=1,W=σlevel2,Vt=σobst2(b) Cubic Spline Smoothing DLM.This model extends the first-order DLM by incorporating a local linear trend. The resulting system of equations is written as follows:Equation (4) and (10)μt=μt-1+αt-1+εlevel,εlevel~N0,σlevel2(11)αt=αt-1+εtrend,εtrend~N0,σtrend2In terms of the quadruples of DLM, it is equivalent to(12)xt=μtαt,F=1,0,G=1101,W=σlevel200σtrend2,Vt=σobst2(c) Second-Order DLM.This model extends the cubic spline smoothing DLM by introducing a second linear trend to model changes of the trend level. The second-order DLM is described as follows:Equations (4) and (7) and (13)αt=αt-1+βt-1+εtrend1,εtrend1~N0,σtrend12(14)βt=βt-1+εtrend2,εtrend2~N0,σtrend22(15)xt=μtαtβt,F=1,0,0,G=110011001,W=σlevel2000σtrend12000σtrend22,Vt=σobs(t)2In our travel speed prediction context, yt is observed data of average link travel speed at timet. μt is the unknown average speed at time t. αt is the trend of variation of averages. εlevel and εtrend are the corresponding error terms, respectively. Note that more complicated DLMs using a higher-order trend component or combining a systematic seasonal variation component and a regression component can also be specified.


## 2.1. Bayesian Forecasting Framework

Step 1 (initialization).
Initialize system state variablesx0 (i.e., travel speed on a road section/link) at t=0. (3)x0∣D0~Nm0,C0,where m0 denotes the estimated means of link travel speed at t=0; C0 is the estimated variance based on the initial information set D0 (i.e., historical travel speed data on network). Set t=t0.Step 2 (prior distribution estimation).
Estimate the prior distribution ofxt as(4)xt∣Dt-1~Nat,Rtwithat=Gtmt-1andRt=GtCt-1Gt′+Wtwhere N(at,Rt) is the normal distribution. at is the estimated mean of system states, and Rt is the estimated variance of system states. We can observe that increasing Gt or Wt will amplify the variance of xt.Step 3 (one-step forecast).
Estimate one-step forecast foryt as(5)yt∣Dt-1~Nft,Qtwithft=Ft′atandQt=Ft′RtFt+Vtwhere ft is the mean of prediction at t and Qt is the variance of prediction at t. We can observed that if Ft (i.e., design matrix) is constant,ft∝at=Gtmt-1 and Qt∝Rt+Vt.Step 4 (posterior distribution att).
Calculate the posterior distributionxt∣Dt as(6)xt∣Dt~Nmt,Ctwithmt=at+AtetandCt=Rt-AtQtAt′where At=RtFtQt-1 and et=yt-ft. IfFt=1, then At=Rt/Qt.Step 5 (iterate).
Sett=t+1. If t=T then stop; otherwise go to Step 1.The proof of the one-step forecast and the posterior distribution can be found in [23]. Note that, for the univariate DLM, it has been shown that the covariance of system evolution Wt needs to adapt to drastic system behavior changes or regime shift [23]. Regardless of this issue will make a serious prediction bias [12]. However, none of the existing studies propose any adaptive parameter estimation for Wt to address this issue.We specify three DLMs, i.e., first-order DLM, cubic spline smoothing DLM, and second-order DLM with increasing complexity based on the above DLM forecasting framework for travel speed prediction on a road network. The aim is to provide the benchmarks to compare with the performance of the proposed adaptive parameter updating DLM. The three DLMs are described as follows.(a) First-Order DLM.This is the basic DLM which incorporates a mean level term and a Gaussian noisy term to describe system state evolution. (7)yt=μt+εobs,εt~N0,σobs2(8)μt=μt-1+εlevel,εlevel~N0,σlevel2(9)xt=μt,F=G=1,W=σlevel2,Vt=σobst2(b) Cubic Spline Smoothing DLM.This model extends the first-order DLM by incorporating a local linear trend. The resulting system of equations is written as follows:Equation (4) and (10)μt=μt-1+αt-1+εlevel,εlevel~N0,σlevel2(11)αt=αt-1+εtrend,εtrend~N0,σtrend2In terms of the quadruples of DLM, it is equivalent to(12)xt=μtαt,F=1,0,G=1101,W=σlevel200σtrend2,Vt=σobst2(c) Second-Order DLM.This model extends the cubic spline smoothing DLM by introducing a second linear trend to model changes of the trend level. The second-order DLM is described as follows:Equations (4) and (7) and (13)αt=αt-1+βt-1+εtrend1,εtrend1~N0,σtrend12(14)βt=βt-1+εtrend2,εtrend2~N0,σtrend22(15)xt=μtαtβt,F=1,0,0,G=110011001,W=σlevel2000σtrend12000σtrend22,Vt=σobs(t)2In our travel speed prediction context, yt is observed data of average link travel speed at timet. μt is the unknown average speed at time t. αt is the trend of variation of averages. εlevel and εtrend are the corresponding error terms, respectively. Note that more complicated DLMs using a higher-order trend component or combining a systematic seasonal variation component and a regression component can also be specified.


## 3. Adaptive Parameter Updating for DLM

### 3.1. Adaptive DLM

We propose an adaptive parameter updating approach based on the first-order DLM. We have two unknown parameters, i.e.,Vt and Wt, to be estimated. The two parameters determine the predicted system states and influence the accuracy of prediction. To estimate the unknown model parameters, we can construct the likelihood function based on observed data as a function of unknown parameters. The maximum likelihood estimation approach is used to estimate the parameters [34]. The log-likelihood function is written as follows [33, 35]: (16)LLθ=-12∑t=1TlogQt-12∑t=1Tyt-ft′Qt-1yt-ftwhere θ denotes the unknown parameters, i.e., θ=(Vt,Wt). Qt and ft are the variances and means of prediction at time t (see (5)), respectively. The maximum likelihood estimates (MLE) of parameters can then be obtained by solving the following optimization problem(17)θ^=argmaxθ⁡LLθIn classical DLMs, the system parameters θ are constant regardless system regime changes. Fei et al. [19] proposed an intervention approach by adjusting the model error covariance based on anticipated changes from additional exterior information and/or expert’s knowledge. The drawback is expert’s adjustment might be trivial and lack a system-wide control based on the feedback of prediction errors.Different with existing approach, we propose a two-stage algorithm by first estimating initial parametersθ0 based on a training data set and then using an online adaptive parameter updating based on the feedback of one-step prediction errors. It is similar to feedback control to optimize the model parameters. The proposed two-stage adaptive parameter updating approach is described as follows.


### 3.2. Online Adaptive Parameter Updating Approach

The proposed approach estimates the model parameters (V0,W0) based on historical data and adaptively optimizes its model parameters over time based on one-step model prediction errors. The approach is described as follows.Step 1 (initial parameter estimation).
(i)
EstimateV^0 and W^0: given input training data setD, compute MLE estimates of V^0 and W^0. Get v^0=V^0. (ii)
OptimizeW0: given v0, find the optimal signal-to-noise ratio s^ (i.e., w/v0) as (18)s^=argminsGy∣θ whereG(y∣θ) is a loss function defined by the root mean square error. The optimal estimates of model error covariance for the training data set can then be obtained as W^0∗=s^2V^0.Step 2 (online adaptive parameter updating).
SetVt=V^0 and Wt=W^0∗ and compute one-step forecast y^t and prediction error εt=yt-y^t based on (4)-(6). Given a predefined tolerable threshold τ, update Wt+1 as(19)Wt+1=s^t+12Vtifεt≥τWtotherwisewhere s^t+1=arg⁡mins⁡G(y∣Dt,θ). Vt is kept constant. Note that one can obtain s^t+1 without difficulty by the golden section search or the line search approach [36].The online adaptive parameter updating approach is shown in Figure1.Figure 1
Online adaptive parameter updating approach.


### 3.3. Measure Metrics for Assessing Prediction Accuracy

To measure the accuracy of prediction, two metrics are applied:(1) Root Mean Square Error (RMSE); (2) Mean Absolute Error (MAE). The first one computes the mean of squared error terms. The second one reports the mean of absolute errors. The definitions are as follows.(a) Mean absolute error (MAE) measures the average magnitude of prediction errors by taking into account all observation equally.(20)MAE=1N∑i=1Nyi-y^iwhere N is the total number of observation. yi and y^i are the observation and prediction values of sample i, respectively.(b) Root Mean Square Error (RMSE) is a second-order measure for prediction errors.(21)RMSE=1N∑i=1Nyi-y^i21/2The RMSE is a kind of second-order measure of prediction errors. Note MAE and RMSE provide similar measures for quantifying the model prediction errors. However, RMSE weights more to large errors providing more desired property when large errors are undesirable.


## 3.1. Adaptive DLM

We propose an adaptive parameter updating approach based on the first-order DLM. We have two unknown parameters, i.e.,Vt and Wt, to be estimated. The two parameters determine the predicted system states and influence the accuracy of prediction. To estimate the unknown model parameters, we can construct the likelihood function based on observed data as a function of unknown parameters. The maximum likelihood estimation approach is used to estimate the parameters [34]. The log-likelihood function is written as follows [33, 35]: (16)LLθ=-12∑t=1TlogQt-12∑t=1Tyt-ft′Qt-1yt-ftwhere θ denotes the unknown parameters, i.e., θ=(Vt,Wt). Qt and ft are the variances and means of prediction at time t (see (5)), respectively. The maximum likelihood estimates (MLE) of parameters can then be obtained by solving the following optimization problem(17)θ^=argmaxθ⁡LLθIn classical DLMs, the system parameters θ are constant regardless system regime changes. Fei et al. [19] proposed an intervention approach by adjusting the model error covariance based on anticipated changes from additional exterior information and/or expert’s knowledge. The drawback is expert’s adjustment might be trivial and lack a system-wide control based on the feedback of prediction errors.Different with existing approach, we propose a two-stage algorithm by first estimating initial parametersθ0 based on a training data set and then using an online adaptive parameter updating based on the feedback of one-step prediction errors. It is similar to feedback control to optimize the model parameters. The proposed two-stage adaptive parameter updating approach is described as follows.


## 3.2. Online Adaptive Parameter Updating Approach

The proposed approach estimates the model parameters (V0,W0) based on historical data and adaptively optimizes its model parameters over time based on one-step model prediction errors. The approach is described as follows.Step 1 (initial parameter estimation).
(i)
EstimateV^0 and W^0: given input training data setD, compute MLE estimates of V^0 and W^0. Get v^0=V^0. (ii)
OptimizeW0: given v0, find the optimal signal-to-noise ratio s^ (i.e., w/v0) as (18)s^=argminsGy∣θ whereG(y∣θ) is a loss function defined by the root mean square error. The optimal estimates of model error covariance for the training data set can then be obtained as W^0∗=s^2V^0.Step 2 (online adaptive parameter updating).
SetVt=V^0 and Wt=W^0∗ and compute one-step forecast y^t and prediction error εt=yt-y^t based on (4)-(6). Given a predefined tolerable threshold τ, update Wt+1 as(19)Wt+1=s^t+12Vtifεt≥τWtotherwisewhere s^t+1=arg⁡mins⁡G(y∣Dt,θ). Vt is kept constant. Note that one can obtain s^t+1 without difficulty by the golden section search or the line search approach [36].The online adaptive parameter updating approach is shown in Figure1.Figure 1
Online adaptive parameter updating approach.


## 3.3. Measure Metrics for Assessing Prediction Accuracy

To measure the accuracy of prediction, two metrics are applied:(1) Root Mean Square Error (RMSE); (2) Mean Absolute Error (MAE). The first one computes the mean of squared error terms. The second one reports the mean of absolute errors. The definitions are as follows.(a) Mean absolute error (MAE) measures the average magnitude of prediction errors by taking into account all observation equally.(20)MAE=1N∑i=1Nyi-y^iwhere N is the total number of observation. yi and y^i are the observation and prediction values of sample i, respectively.(b) Root Mean Square Error (RMSE) is a second-order measure for prediction errors.(21)RMSE=1N∑i=1Nyi-y^i21/2The RMSE is a kind of second-order measure of prediction errors. Note MAE and RMSE provide similar measures for quantifying the model prediction errors. However, RMSE weights more to large errors providing more desired property when large errors are undesirable.


## 4. Experimental Study

### 4.1. Experimental Settings and Link Speed Data

We generate realistic travel speed data by microscopic traffic simulations implemented by SUMO [37], a widely used microscopic traffic simulation. The test area is selected from Luxembourg City and its surrounding areas [38, 39]. The travel speed data is collected from the simulator on 13 main road sections in Luxembourg City (Figure 2) in the morning peak-hour period from 7:00-9:00. Link average travel speed is aggregated in a 5-minute aggregation interval (i.e., 7:00,7:05,7:10,…,9:00) as is the case for most realistic applications [40]. The data is freely available at https://github.com/pigne/2019-simulations-DLM.Figure 2
Luxembourg road network and traffic count positions. There are totally 13 traffic counts located over main road sections around Luxembourg City and the quarter of European Union Institutions (Kirchberg). The red car is the accident scenario occurring on Grand Duchess Charlotte Bridge standing in way for the direction to east during a.m. 7:30 to a.m. 8:00.We consider two scenarios: normal traffic without accidents and traffic with an accident occurred during 7:30-8:00 on the Grand Duchess Charlotte Bridge (see Figure2) connecting European Institution quarter and Luxembourg City center. Travel demand is generated based on the realistic LUST traffic demand scenarios for Luxembourg [41] which represents the daily mobility patterns of peoples working/living in the study area. We generate one training data set for initial DLM parameter estimation under normal traffic situation and one test data set under accident situations. The aim is to test the performance of the proposed adaptive parameter updating approach under unforeseen event. The generated traffic patterns are different from one day to another due to stochastic behavior of traffic.The travel speed profiles on three road sections around the accidental site (road sections 3, 4, and 5) for normal and accidental scenarios are shown in Figure3. In the normal traffic scenario, there are some frustrations on road section 3W and 4W (direction for Luxembourg City center). When an accident occurs (see the right part in Figure 3), traffic is heavily impacted on the road section 5 for both directions and on the road sections 3 and 4 to its east direction. We can find there is significant travel speed reduction on nearby roads due to the accident event. The numerical is executed by DLM Matlab Toolbox (https://mjlaine.github.io/dlm/) using a Dell Latitude E5470 laptop with win64 OS, Intel i5-6300U CPU, 2 Cores and 8GB memory.Figure 3
Examples of observed average speeds on road sections 3, 4, and 5 for both directions (direction east (E) and direction west (W)). Left: normal traffic scenario. Right: accident scenario (accident on the Grand Duchess Charlotte Bridge).


### 4.2. Result

#### 4.2.1. Initial Parameter Estimation of the Adaptive DLM

We use the MLE method to obtain an initial estimate ofV0 and W0 based on the training data set, i.e., observations in the normal traffic scenario. The optimal signal-to-noise ratio with a minimal RMSE value of the one-step forecast can be obtained (Figure 4). The RMSE values is a function of signal-to-noise ratio which decreases at the beginning and then increases until a stable value when increasing the signal-to-noise ratio. We estimate the optimal signal-to-noise ratios and optimal model error covariance for each link. Figure 4 shows the first-order DLM obtains best fits (i.e., lowest RMSE) compared to the second-order DLM and the cubic spline smoothing DLM model. In normal traffic scenario, traffic speed presents small fluctuation for most of the time. The evolution function in the first-order DLM captures smooth changes of mean state traffic evolution with best goodness-of-fit. However, higher-order DLMs might overfit local trend resulting in higher prediction error.Figure 4
Influence of the signal-to-noise ratio (w/v) on one-step forecast accuracy of DLMs on traffic data on road section 4E.Figure5 reports the local trends of the DLMs with and without optimizing signal-to-noise ratio to minimize the RMSE. We found that, after optimizing the signal-to-noise ratio, the fitted Kalman filter smoother becomes more adaptive to observations (on the right side of Figure 5). The DLM Kalman filter smoother has smaller variance with MLE parameters. In terms of one-step forecast accuracy, the prediction accuracy is improved when applying the optimized signal-to-noise ratio in the MLE models.Figure 5
First-order DLM Kalman filter smoother fitted on average travel speed on link 4E. On the left: parameters (V0,W0) estimated by MLE; on the right: after optimization.


#### 4.2.2. Online Adaptive Parameter Updating

We test the performance of the proposed approach to the traffic accident scenario. As we can see on Figure2, when the traffic accident occurs, its upstream and downstream road sections, i.e., road sections 3, 4, and 5, would have significant impacts. Hence it would be interesting to investigate the performance of the proposed method on these road sections.Table1 shows the adaptive DLM significantly outperforms the other methods for the cases of major changes in traffic on road sections 3, 4, and 5. The average RMSE of the adaptive DLM over the road sections 3, 4, and 5 is 4.480, compared to the HW Exponential Smoothing method (4.612), AR(2) (4.653) and the three DLM approaches. It outperforms the simple one-step shift predictor (i.e., using observations at time t as predictors for t+1) in both accidental and normal traffic road sections. The values of the MAE measure claim the same conclusion. However, on the other road sections, the adaptive DLM performs similar well compared with the other approaches. The average execution of the adaptive DLM for each road section is 0.1082 second.Table 1
Average prediction accuracy of the adaptive DLM in accident scenarios.
Measure metrics Road Section First-order DLM Cubic spline smoothing DLM Second-order DLM AR(2) HW Exp. Smoothing One-step shiftpredictor Adaptive DLM RMSE 3, 4 and 5 4.901 5.450 5.537 4.653 4.612 4.830 4.480 Others 1.948 2.155 2.530 2.587 2.596 2.336 2.020  MAE 3, 4 and 5 3.398 4.029 4.071 2.63 2.666 2.814 2.595 Others 1.511 1.655 1.913 1.446 1.469 1.741 1.500To illustrate the effectiveness of reducing prediction errors of the proposed method in case of major changes in traffic, we investigate two road sections which are significantly impacted by the accident, i.e., 4E and 5W. We can find travel speed quickly drop at about 7:40, and the traffic becomes fluid at about 8:05 on both road sections (see Figure3, on the right). As shown in Figure 6 for road section 5W, the classical DLM with constant model parameters generates a quite biased one-step forecast due to such a sudden change (black line). However, the proposed method provides adaptive one-step forecasts during and after accidents (red line). The comparison of absolute errors obtained by the classical DLM and the adaptive DLM is shown on the right side of Figure 6. Figure 7 compares the performance of different DLM models for the road section 4E. The result shows the adaptive DLM model obtains more accurate prediction compared to the other DLM models. Figure 8 reports the profile of adaptive optimal signal-to-noise ratios at each time step. We use the standard deviation of travel speed in the normal traffic scenario to estimate the tolerable threshold in (19).Figure 6
Comparison of one-step forecasts and absolute errors for first-order DLM and the adaptive DLM in accident scenarios (road section 5W).Left: the one-step forecasts of average speed.Right: absolute residuals.Figure 7
Comparison of the performance of different DLM models in unforeseen accident situation (road section 4E).Figure 8
Adaptive parameter updating of DLM model in unforeseen accident situation (road section 5W).


## 4.1. Experimental Settings and Link Speed Data

We generate realistic travel speed data by microscopic traffic simulations implemented by SUMO [37], a widely used microscopic traffic simulation. The test area is selected from Luxembourg City and its surrounding areas [38, 39]. The travel speed data is collected from the simulator on 13 main road sections in Luxembourg City (Figure 2) in the morning peak-hour period from 7:00-9:00. Link average travel speed is aggregated in a 5-minute aggregation interval (i.e., 7:00,7:05,7:10,…,9:00) as is the case for most realistic applications [40]. The data is freely available at https://github.com/pigne/2019-simulations-DLM.Figure 2
Luxembourg road network and traffic count positions. There are totally 13 traffic counts located over main road sections around Luxembourg City and the quarter of European Union Institutions (Kirchberg). The red car is the accident scenario occurring on Grand Duchess Charlotte Bridge standing in way for the direction to east during a.m. 7:30 to a.m. 8:00.We consider two scenarios: normal traffic without accidents and traffic with an accident occurred during 7:30-8:00 on the Grand Duchess Charlotte Bridge (see Figure2) connecting European Institution quarter and Luxembourg City center. Travel demand is generated based on the realistic LUST traffic demand scenarios for Luxembourg [41] which represents the daily mobility patterns of peoples working/living in the study area. We generate one training data set for initial DLM parameter estimation under normal traffic situation and one test data set under accident situations. The aim is to test the performance of the proposed adaptive parameter updating approach under unforeseen event. The generated traffic patterns are different from one day to another due to stochastic behavior of traffic.The travel speed profiles on three road sections around the accidental site (road sections 3, 4, and 5) for normal and accidental scenarios are shown in Figure3. In the normal traffic scenario, there are some frustrations on road section 3W and 4W (direction for Luxembourg City center). When an accident occurs (see the right part in Figure 3), traffic is heavily impacted on the road section 5 for both directions and on the road sections 3 and 4 to its east direction. We can find there is significant travel speed reduction on nearby roads due to the accident event. The numerical is executed by DLM Matlab Toolbox (https://mjlaine.github.io/dlm/) using a Dell Latitude E5470 laptop with win64 OS, Intel i5-6300U CPU, 2 Cores and 8GB memory.Figure 3
Examples of observed average speeds on road sections 3, 4, and 5 for both directions (direction east (E) and direction west (W)). Left: normal traffic scenario. Right: accident scenario (accident on the Grand Duchess Charlotte Bridge).


## 4.2. Result

### 4.2.1. Initial Parameter Estimation of the Adaptive DLM

We use the MLE method to obtain an initial estimate ofV0 and W0 based on the training data set, i.e., observations in the normal traffic scenario. The optimal signal-to-noise ratio with a minimal RMSE value of the one-step forecast can be obtained (Figure 4). The RMSE values is a function of signal-to-noise ratio which decreases at the beginning and then increases until a stable value when increasing the signal-to-noise ratio. We estimate the optimal signal-to-noise ratios and optimal model error covariance for each link. Figure 4 shows the first-order DLM obtains best fits (i.e., lowest RMSE) compared to the second-order DLM and the cubic spline smoothing DLM model. In normal traffic scenario, traffic speed presents small fluctuation for most of the time. The evolution function in the first-order DLM captures smooth changes of mean state traffic evolution with best goodness-of-fit. However, higher-order DLMs might overfit local trend resulting in higher prediction error.Figure 4
Influence of the signal-to-noise ratio (w/v) on one-step forecast accuracy of DLMs on traffic data on road section 4E.Figure5 reports the local trends of the DLMs with and without optimizing signal-to-noise ratio to minimize the RMSE. We found that, after optimizing the signal-to-noise ratio, the fitted Kalman filter smoother becomes more adaptive to observations (on the right side of Figure 5). The DLM Kalman filter smoother has smaller variance with MLE parameters. In terms of one-step forecast accuracy, the prediction accuracy is improved when applying the optimized signal-to-noise ratio in the MLE models.Figure 5
First-order DLM Kalman filter smoother fitted on average travel speed on link 4E. On the left: parameters (V0,W0) estimated by MLE; on the right: after optimization.


### 4.2.2. Online Adaptive Parameter Updating

We test the performance of the proposed approach to the traffic accident scenario. As we can see on Figure2, when the traffic accident occurs, its upstream and downstream road sections, i.e., road sections 3, 4, and 5, would have significant impacts. Hence it would be interesting to investigate the performance of the proposed method on these road sections.Table1 shows the adaptive DLM significantly outperforms the other methods for the cases of major changes in traffic on road sections 3, 4, and 5. The average RMSE of the adaptive DLM over the road sections 3, 4, and 5 is 4.480, compared to the HW Exponential Smoothing method (4.612), AR(2) (4.653) and the three DLM approaches. It outperforms the simple one-step shift predictor (i.e., using observations at time t as predictors for t+1) in both accidental and normal traffic road sections. The values of the MAE measure claim the same conclusion. However, on the other road sections, the adaptive DLM performs similar well compared with the other approaches. The average execution of the adaptive DLM for each road section is 0.1082 second.Table 1
Average prediction accuracy of the adaptive DLM in accident scenarios.
Measure metrics Road Section First-order DLM Cubic spline smoothing DLM Second-order DLM AR(2) HW Exp. Smoothing One-step shiftpredictor Adaptive DLM RMSE 3, 4 and 5 4.901 5.450 5.537 4.653 4.612 4.830 4.480 Others 1.948 2.155 2.530 2.587 2.596 2.336 2.020  MAE 3, 4 and 5 3.398 4.029 4.071 2.63 2.666 2.814 2.595 Others 1.511 1.655 1.913 1.446 1.469 1.741 1.500To illustrate the effectiveness of reducing prediction errors of the proposed method in case of major changes in traffic, we investigate two road sections which are significantly impacted by the accident, i.e., 4E and 5W. We can find travel speed quickly drop at about 7:40, and the traffic becomes fluid at about 8:05 on both road sections (see Figure3, on the right). As shown in Figure 6 for road section 5W, the classical DLM with constant model parameters generates a quite biased one-step forecast due to such a sudden change (black line). However, the proposed method provides adaptive one-step forecasts during and after accidents (red line). The comparison of absolute errors obtained by the classical DLM and the adaptive DLM is shown on the right side of Figure 6. Figure 7 compares the performance of different DLM models for the road section 4E. The result shows the adaptive DLM model obtains more accurate prediction compared to the other DLM models. Figure 8 reports the profile of adaptive optimal signal-to-noise ratios at each time step. We use the standard deviation of travel speed in the normal traffic scenario to estimate the tolerable threshold in (19).Figure 6
Comparison of one-step forecasts and absolute errors for first-order DLM and the adaptive DLM in accident scenarios (road section 5W).Left: the one-step forecasts of average speed.Right: absolute residuals.Figure 7
Comparison of the performance of different DLM models in unforeseen accident situation (road section 4E).Figure 8
Adaptive parameter updating of DLM model in unforeseen accident situation (road section 5W).


## 4.2.1. Initial Parameter Estimation of the Adaptive DLM

We use the MLE method to obtain an initial estimate ofV0 and W0 based on the training data set, i.e., observations in the normal traffic scenario. The optimal signal-to-noise ratio with a minimal RMSE value of the one-step forecast can be obtained (Figure 4). The RMSE values is a function of signal-to-noise ratio which decreases at the beginning and then increases until a stable value when increasing the signal-to-noise ratio. We estimate the optimal signal-to-noise ratios and optimal model error covariance for each link. Figure 4 shows the first-order DLM obtains best fits (i.e., lowest RMSE) compared to the second-order DLM and the cubic spline smoothing DLM model. In normal traffic scenario, traffic speed presents small fluctuation for most of the time. The evolution function in the first-order DLM captures smooth changes of mean state traffic evolution with best goodness-of-fit. However, higher-order DLMs might overfit local trend resulting in higher prediction error.Figure 4
Influence of the signal-to-noise ratio (w/v) on one-step forecast accuracy of DLMs on traffic data on road section 4E.Figure5 reports the local trends of the DLMs with and without optimizing signal-to-noise ratio to minimize the RMSE. We found that, after optimizing the signal-to-noise ratio, the fitted Kalman filter smoother becomes more adaptive to observations (on the right side of Figure 5). The DLM Kalman filter smoother has smaller variance with MLE parameters. In terms of one-step forecast accuracy, the prediction accuracy is improved when applying the optimized signal-to-noise ratio in the MLE models.Figure 5
First-order DLM Kalman filter smoother fitted on average travel speed on link 4E. On the left: parameters (V0,W0) estimated by MLE; on the right: after optimization.


## 4.2.2. Online Adaptive Parameter Updating

We test the performance of the proposed approach to the traffic accident scenario. As we can see on Figure2, when the traffic accident occurs, its upstream and downstream road sections, i.e., road sections 3, 4, and 5, would have significant impacts. Hence it would be interesting to investigate the performance of the proposed method on these road sections.Table1 shows the adaptive DLM significantly outperforms the other methods for the cases of major changes in traffic on road sections 3, 4, and 5. The average RMSE of the adaptive DLM over the road sections 3, 4, and 5 is 4.480, compared to the HW Exponential Smoothing method (4.612), AR(2) (4.653) and the three DLM approaches. It outperforms the simple one-step shift predictor (i.e., using observations at time t as predictors for t+1) in both accidental and normal traffic road sections. The values of the MAE measure claim the same conclusion. However, on the other road sections, the adaptive DLM performs similar well compared with the other approaches. The average execution of the adaptive DLM for each road section is 0.1082 second.Table 1
Average prediction accuracy of the adaptive DLM in accident scenarios.
Measure metrics Road Section First-order DLM Cubic spline smoothing DLM Second-order DLM AR(2) HW Exp. Smoothing One-step shiftpredictor Adaptive DLM RMSE 3, 4 and 5 4.901 5.450 5.537 4.653 4.612 4.830 4.480 Others 1.948 2.155 2.530 2.587 2.596 2.336 2.020  MAE 3, 4 and 5 3.398 4.029 4.071 2.63 2.666 2.814 2.595 Others 1.511 1.655 1.913 1.446 1.469 1.741 1.500To illustrate the effectiveness of reducing prediction errors of the proposed method in case of major changes in traffic, we investigate two road sections which are significantly impacted by the accident, i.e., 4E and 5W. We can find travel speed quickly drop at about 7:40, and the traffic becomes fluid at about 8:05 on both road sections (see Figure3, on the right). As shown in Figure 6 for road section 5W, the classical DLM with constant model parameters generates a quite biased one-step forecast due to such a sudden change (black line). However, the proposed method provides adaptive one-step forecasts during and after accidents (red line). The comparison of absolute errors obtained by the classical DLM and the adaptive DLM is shown on the right side of Figure 6. Figure 7 compares the performance of different DLM models for the road section 4E. The result shows the adaptive DLM model obtains more accurate prediction compared to the other DLM models. Figure 8 reports the profile of adaptive optimal signal-to-noise ratios at each time step. We use the standard deviation of travel speed in the normal traffic scenario to estimate the tolerable threshold in (19).Figure 6
Comparison of one-step forecasts and absolute errors for first-order DLM and the adaptive DLM in accident scenarios (road section 5W).Left: the one-step forecasts of average speed.Right: absolute residuals.Figure 7
Comparison of the performance of different DLM models in unforeseen accident situation (road section 4E).Figure 8
Adaptive parameter updating of DLM model in unforeseen accident situation (road section 5W).


## 5. Conclusions

In this study, we propose an online adaptive DLM algorithm for time series data analysis and forecasting. The proposed method is applied for short-term travel speed forecasts in urban areas based on a microscopic traffic simulator. The experiments show the proposed method allows adaptively optimizing its model parameters to improve its prediction accuracy in a continuous way under uncertainty. The proposed method does not need the intervention of experts and can adjust its model error covariance automatically based on feedback information of its one-step prediction errors.Experimental studies show that our adaptive DLM approach outperforms both autoregressive integrated moving average (ARIMA) and Holt-Winters Exponential Smoothing (ETS) that are both considered to be the main time series analysis methods employed on this type of problems [28]. We thus consider that this comparison is a reasonable proxy to a comparison with other online models for travel speed prediction that use ARIMA or ETS.Future extensions concern an adaptive parameter updating scheme design for the state space methods and for more complicated DLMs with seasonal and regression terms. Applications of the proposed method on other time series data would also be beneficial for assessing and improving its performance.



---

*Source: 5314520-2019-06-23.xml*