﻿ 基于现实与虚拟交互的交通流再现实验方法
 文章快速检索
 同济大学学报(自然科学版)  2018, Vol. 46 Issue (12): 1659-1667.  DOI: 10.11908/j.issn.0253-374x.2018.12.007 0

### 引用本文

YANG Xiaoguang, ZHANG Nan. An Experimental Method for Reproducing Traffic Flow Based on Reality and VirtualInteraction[J]. Journal of Tongji University (Natural Science), 2018, 46(12): 1659-1667. DOI: 10.11908/j.issn.0253-374x.2018.12.007

### 文章历史

An Experimental Method for Reproducing Traffic Flow Based on Reality and VirtualInteraction
YANG Xiaoguang , ZHANG Nan
Key Laboratory of Road and Traffic Engineering of the Ministry of Education, Tongji University, Shanghai 201804, China
Abstract: With the development and application of information technology, it is becoming a new research direction to analyze complex traffic flow based on experimental methods. One of the basic problems is the reproduction of the actual traffic flow in the experiment. Based on the framework of a traffic flow experimental system, this paper proposes an experimental method to reproduce the real traffic flow in virtual environment by giving the observation data of traffic flow in real environment whose system framework includes the nonparametric model of traffic flow and the Bayesian learning algorithm. Subsequently, the experimental method was numerically verified in the scene of traffic flow on signal control. The results show that the method proposed could realize the approximate dynamic traffic flow on signal control in virtual environment.
Key words: experimental traffic engineering    traffic flow    nonparametric method    variational Bayesian learning    Markov chain Monte Carlo mathod

1 交通流再现问题研究综述

 图 1 交通流实验系统框架与交通战略实验室 Fig.1 Framework of traffic flow experimental system in traffic strategy laboratory

2 交通流再现实验方法 2.1 交通流再现问题的非参数定义

 $\hat p\left( {H,\theta } \right) \propto \arg \max p\left( {H,\theta \left| {M,O} \right.} \right)$ (1)
2.2 交通流再现实验的贝叶斯学习方法

 $p\left( {H,\theta \left| {M,O} \right.} \right) \propto p\left( {O\left| {M,H,\theta } \right.} \right)p\left( H \right)p\left( \theta \right)$ (2)

 $\begin{array}{l} \ln p\left( {O\left| {M,H,\theta } \right.} \right) = \ln \int {p\left( {\theta ,H\left| {O,M} \right.} \right){\rm{d}}H{\rm{d}}\theta } \ge \\ \int {{q_H}\left( H \right){q_\theta }\left( \theta \right)\ln \frac{{p\left( {\theta ,H\left| {O,M} \right.} \right)}}{{{q_H}\left( H \right){q_\theta }\left( \theta \right)}}{\rm{d}}H{\rm{d}}\theta } \end{array}$ (3)

 $L\left( q \right) \equiv \int {{q_H}\left( H \right){q_\theta }\left( \theta \right)\ln \frac{{p\left( {\theta ,H\left| {O,M} \right.} \right)}}{{{q_H}\left( H \right){q_\theta }\left( \theta \right)}}{\rm{d}}H{\rm{d}}\theta }$ (4)

 ${q_H}\left( H \right){q_\theta }\left( \theta \right) \approx p\left( {\theta ,H\left| {O,M} \right.} \right)$ (5)

3 信号控制交通流再现实验

 图 2 信号控制交通系统基本组成与模型表示 Fig.2 Basic composition and model representation of traffic system on signal control
3.1 路网模型与控制模型

3.2 交通流模型

 图 3 信号控制条件下交通流状态划分 Fig.3 Traffic flow state division in the condition of signal control

 $p\left( {{z_t}\left| {{z_{t - 1}}} \right.} \right):{\mathit{\boldsymbol{\pi }}_{{z_{t - 1}}}}$ (6)
 $\mathit{\boldsymbol{\rho }}\left( {t + \Delta t} \right) = \mathit{\boldsymbol{\rho }}\left( t \right) + \frac{{\Delta t}}{{{l_x}}}\left( {{f_{{z_t}}}\left( {\mathit{\boldsymbol{\rho }}\left( t \right)} \right)} \right) + e_t^{\left( {{z_t}} \right)}$ (7)
 ${f_{{z_t}}}\left( {\mathit{\boldsymbol{\rho }}\left( t \right)} \right) = {A_{{z_t}}}\mathit{\boldsymbol{\rho }}\left( t \right) + {\mathit{\boldsymbol{B}}_{{\rm{J}},{z_t}}}{\mathit{\boldsymbol{\rho }}_{\rm{J}}} + {\mathit{\boldsymbol{B}}_{{\rm{Q}},{z_t}}}{\mathit{\boldsymbol{q}}_{\max }}$ (8)
 $\mathit{\boldsymbol{y}}\left( {t + \Delta t} \right) = \mathit{\boldsymbol{C\rho }}\left( {t + \Delta t} \right) + {w_t}$ (9)

 图 4 动态交通流的马尔科夫过程图形表示 Fig.4 Graph of Markov process for dynamic traffic flow
3.3 再现实验框架与算法

 图 5 交通流宏观参数再现实验框架 Fig.5 Experimental framework for reproduced macroscopic parameters of traffic flow

(1) 抽样交通密度序列${\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}}$.在给定状态模式序列${\left\{ {{z_t}} \right\}_{1:T}}$，系数矩阵Θ(zt)，以及其他经验参数的条件下，图 4中的模型，转变为只含有第2层未知变量的HMM.当ρt服从高斯分布作为先验分布，见公式(7)、(8).此时，交通密度序列${\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}}$的后验概率计算公式为可以利用高斯HMM的前向-后向传递算法(forward-backward algorithm)进行计算[28], 该算法是利用马尔科夫性质，将全部序列的边缘概率密度的积分计算转变为局部的积分计算.根据该算法状态序列的后验概率分布计算公式为

 $\begin{array}{l} p\left( {{\mathit{\boldsymbol{\rho }}_t}\left| {{\mathit{\boldsymbol{\rho }}_{t - 1}}} \right.,{\mathit{\boldsymbol{y}}_{1:T}},{z_{1:T}}} \right) \propto \\ p\left( {{\mathit{\boldsymbol{\rho }}_t}\left| {{\mathit{\boldsymbol{\rho }}_{t - 1}}} \right.,{\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{\left( {{z_t}} \right)}},e_t^{\left( {{z_t}} \right)}} \right)p\left( {{\mathit{\boldsymbol{y}}_t}\left| {{\mathit{\boldsymbol{\rho }}_t},{\mathit{\boldsymbol{R}}_t}} \right.} \right){m_{t + 1,t}}\left( {{\mathit{\boldsymbol{\rho }}_t}} \right) \end{array}$ (10)

 $\begin{array}{l} {m_{t,t - 1}}\left( {{\mathit{\boldsymbol{\rho }}_{t - 1}}} \right) \propto \\ \;\;\;\;\;\;\;\int_\gamma ^p {\left( {{\mathit{\boldsymbol{\rho }}_t}\left| {{\mathit{\boldsymbol{\rho }}_{t - 1}}} \right.,{z_t}} \right)p\left( {{\mathit{\boldsymbol{y}}_t}\left| {{\mathit{\boldsymbol{\rho }}_t}} \right.} \right){m_{t + 1,t}}\left( {{\mathit{\boldsymbol{\rho }}_t}} \right){\rm{d}}{\mathit{\boldsymbol{\rho }}_t}} \end{array}$ (11)

t时刻，$p\left( {{\mathit{\boldsymbol{\rho }}_t}|{\mathit{\boldsymbol{\rho }}_{t - 1}}, {\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{({z_t})}}, e_t^{({z_t})}} \right)、p\left( {{\mathit{\boldsymbol{y}}_t}|{\mathit{\boldsymbol{\rho }}_t}, {\rm{ }}{\mathit{\boldsymbol{R}}_t}} \right)$服从高斯分布，所以${m_{t + 1, t}}\left( {{\mathit{\boldsymbol{\rho }}_t}} \right)$服从高斯分布.应用后向信息传递算法，可以利用后向卡尔曼滤波计算公式(10)、(11)中的高斯分布的参数.在观测时段[0, T]内，交通密度的分布是由每一时刻t的分布组成的分布序列，从该分布序列中可以顺序抽样得到交通密度序列${\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}}$.

(2) 抽样状态模式序列${\left\{ {{z_t}} \right\}_{1:T}}$.在给定状态模式序列${\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}}$，以及其他参数的条件下，图 4中的模型，转变为只含有第1层未知变量的HMM.同理，交通流状态模式的后验概率计算公式为

 $\begin{array}{l} p\left( {{z_t}\left| {{z_{t + 1}},{\mathit{\boldsymbol{y}}_{1:T}},\mathit{\boldsymbol{\pi }},} \right.{\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{\left( {{z_t}} \right)}}} \right) \propto \\ \;\;\;\;\;\mathit{\boldsymbol{\pi }}\left( {{z_{t + 1}}} \right)p\left( {{\mathit{\boldsymbol{y}}_{1:T}}\left| {{z_t},{\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{\left( {{z_t}} \right)}}} \right.} \right) \end{array}$ (12)

 $\begin{array}{l} p\left( {{\mathit{\boldsymbol{y}}_{1:T}}\left| {{z_t},{\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{\left( {{z_t}} \right)}}} \right.} \right) \propto \\ \;\;\;\int {p\left( {{\mathit{\boldsymbol{\rho }}_t}\left| {{\mathit{\boldsymbol{\rho }}_{t - 1}}} \right.,{z_t}} \right)p\left( {{\mathit{\boldsymbol{y}}_t}\left| {{\mathit{\boldsymbol{\rho }}_t}} \right.} \right){m_{t + 1,t}}\left( {{\mathit{\boldsymbol{\rho }}_t}} \right){\rm{d}}{\mathit{\boldsymbol{\rho }}_t}} \end{array}$ (13)

(3) 抽样系数矩阵Θ(zt).在给定状态模式序列${\left\{ {{z_t}} \right\}_{1:T}}$和交通密度序列${\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}}$的条件下，系数矩阵的最优后验分布可以应用变分贝叶斯学习进行计算[26]，交通波动速度的后验分布为

 $\begin{array}{l} p\left( {{\omega ^{\left( k \right)}}\left| {{\mathit{\boldsymbol{\rho }}^{\left( k \right)}},{\mathit{\boldsymbol{ \boldsymbol{\varSigma} }}^{\left( k \right)}},{z_t} = k} \right.} \right) \propto \\ \;\;\;\;\;\;p\left( {{\mathit{\boldsymbol{\rho }}^{\left( k \right)}}\left| {{\omega ^{\left( k \right)}}} \right.,{\mathit{\boldsymbol{ \boldsymbol{\varSigma} }}^{\left( k \right)}},{z_t} = k} \right)p\left( {{\omega ^{\left( k \right)}},{z_t} = k} \right) \end{array}$ (14)

(4) 抽样转移矩阵π.在有限状态的HMM中，k个状态之间的转移矩阵为π的先验分布为Dirichlet分布[29].

 $p\left( {\mathit{\boldsymbol{\pi }}\left| {\beta ,k} \right.} \right) \sim {\rm{Dir}}\left( {\beta /k, \cdots ,\beta /k} \right)$ (15)

 $\begin{array}{*{20}{c}} {p\left( {\mathit{\boldsymbol{\pi }}\left| {\beta ,k,{z_{1:T}}} \right.} \right) \propto p\left( {{z_{1:T}}\left| \mathit{\boldsymbol{\pi }} \right.} \right)p\left( {\mathit{\boldsymbol{\pi }}\left| {\beta ,k} \right.} \right) \propto }\\ {{\rm{Dir}}\left( {\beta /k + {n_1}, \cdots ,\beta /k + {n_k}} \right)} \end{array}$ (16)
 ${n_i} = \sum\limits_{i = 1}^k {\delta \left( {{z_i},k} \right)} ,\;\;\;\;\;\forall {z_i} \in {\left\{ {{z_t}} \right\}_{1:T}}$ (17)

 图 6 Gibbs分块抽样算法流程 Fig.6 Gibbs block sampling algorithm

(1) 初始化：设置$\mathit{\boldsymbol{\pi }} = {\rm{ }}{\mathit{\boldsymbol{\pi }}^{(0)}}, \mathit{\boldsymbol{ \boldsymbol{\varTheta} }} = {\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{({z^{(0)}})}}, \mathit{\boldsymbol{\rho }} = \left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}^{(0)}$.

(2) 分块抽样：设置n=1, …, N，计算

① 已知${\left\{ {{y_t}} \right\}_{1:T}}、\left\{ {{z_t}} \right\}_{1:T}^{(n - 1)}$条件下，计算公式(10)、(11)，抽样$\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}^{(n - 1)}$;

② 在已知${\left\{ {{y_t}} \right\}_{1:T}}、\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}^{(n - 1)}$条件下，计算公式(12)、(13)，抽样状态模式$\left\{ {{z_t}} \right\}_{1:T}^{(n - 1)}$;

③ 已知$\left\{ {{z_t}} \right\}_{1:T}^{(n - 1)}、{\rm{ }}\left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}^{(n - 1)}$条件下，按照公式(17)，抽样模型参数${\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{(z_t^{(n - 1)})}}$，之后计算Σ, R;

④ 已知$\left\{ {{z_t}} \right\}_{1:T}^{(n - 1)}$条件下，计算公式(19)，抽样π(n－1);

⑤ 设置$\mathit{\boldsymbol{\pi }} = {\rm{ }}{\mathit{\boldsymbol{\pi }}^{(n - 1)}}, \mathit{\boldsymbol{ \boldsymbol{\varTheta} }} = {\mathit{\boldsymbol{ \boldsymbol{\varTheta} }}^{(z_t^{(n - 1)})}}, \mathit{\boldsymbol{\rho }} = \left\{ {{\mathit{\boldsymbol{\rho }}_t}} \right\}_{1:T}^{(n - 1)}$.

3.4 方法验证与分析

 图 7 实验选取路段与离散化表示 Fig.7 Selection and discrete representation of road section
 图 8 NGSIM交通流数据统计结果(5 s记为1个时段) Fig.8 NGSIM traffic data statistics(Time interval 5 s)

 图 9 交通密度-流量关系图 Fig.9 Flow versus density
 图 10 交通流波动速度实验再现结果与统计值、拟合分布对比 Fig.10 Comparison of experiment result of shockwave speed, statistic value, and fitting distribution

 图 11 交通密度实验再现结果(5 s记为1个时段) Fig.11 Experiment result of traffic density

 图 12 交通波动速度实验再现结果：推断分布抽样值与NG统计值的分位数对比分析 Fig.12 Experiment result of shockwave speed: Normal quantile-quantile plot
4 结论和展望

 [1] MONTOMERY D C. Design and analysis of experiments[M]. 6th ed. Hoboken: John Wiley & Sons Inc, 2006. [2] 杨晓光, 孙剑, 徐建闽, 等.实验交通工程基本理论(方法)与信息技术[C]//建筑、环境与土木工程学科发展战略研究.北京: 科学出版社, 2005: 301-319. YANG Xiaoguang, SUN Jian, XUN Jianmin, et al. The basic theory (method) of experimental traffic engineering and information technology[C]//Research on the Development Strategy of Architecture, Environment and Civil Engineering. Beijing: Science Press, 2005: 301-309. [3] 童梅.面向实验交通系统的建模与计算[D].上海: 同济大学, 2008. TONG Mei. Modeling and computing in experimental transportation systems[D]. Shanghai: Tongji University, 2008. [4] 杨晓光, 孙剑. 面向ITS的交通仿真实验系统[J]. 长沙理工大学学报(自然科学版), 2006, 3(3): 43 YANG Xiaoguang, SUN Jian. Microscopic traffic smiulation and expermiental system under ITS[J]. Journal of Changsha University of Science and Technology (Natural Science), 2006, 3(3): 43 DOI:10.3969/j.issn.1672-9331.2006.03.006 [5] 时柏营.面向交叉口的交通流实验分析方法[D].上海: 同济大学, 2010. SHI Baiying. The experimental method of traffic flow facing intersection[D]. Shanghai: Tongji University, 2010. [6] 杨晓光.交通状态全息感知与交通战略实验室研究报告[R].上海: 同济大学, 2015. YANG Xiaoguang. Traffic state holographic perception and traffic strategy laboratory[R]. Shanghai: Tongji University, 2015. [7] 赵靖.提升道路通行能力时空协同优化控制理论和方法[D].上海: 同济大学, 2014. ZHAO Jing. Urban streets capacity enhancement by coordination optimization of lane reorganization and signale contral[D]. Shanghai: Tongji University, 2014. [8] MIHAYLOVA L, BOEL R, HEGYI A. Freeway traffic estimation within particle filtering framework[J]. Automatica, 2007, 43(2): 290 DOI:10.1016/j.automatica.2006.08.023 [9] SUMALEE A, ZHONG R X, PAN T, et al. Stochastic cell transmission model (SCTM): a stochastic dynamic traffic model for traffic state surveillance and assignment[J]. Transportation Research Part B, 2011, 45(3): 507 DOI:10.1016/j.trb.2010.09.006 [10] SUN X, MUÑOZ L, HOROWITZ R. Highway traffic state estimation using improved mixture Kalman filters for effective ramp metering control[C]//In Proceedings of the 42nd IEEE Conference on Decision and Control. Hawaii: IEEE, 2003: 6333-6338. [11] NANTES A, NGODUY D, BHASKAR A, et al. Real-time traffic state estimation in urban corridors from heterogeneous data[J]. Transportation Research Part C, 2016, 66: 99 DOI:10.1016/j.trc.2015.07.005 [12] OSSEN S, HOOGENDOORN S P. Validity of trajectory-based calibration approach of car-following models in presence of measurement errors[J]. Transportation Research Record, 2008, 2088: 117 DOI:10.3141/2088-13 [13] PUNZO V, CIUFFO B, MONTANINO M. Can results of car-following model calibration based on trajectory data be trusted?[J]. Transportation Research Record, 2012, 2315: 11 DOI:10.3141/2315-02 [14] WANGER P. Analyzing fluctuation in car-following[J]. Transportation Research Part B, 2012, 46: 1384 DOI:10.1016/j.trb.2012.06.007 [15] MARCELLO M, VINCENZO P. Trajectory data reconstruction and simulation-based validation against macroscopic traffic patterns[J]. Transportation Research Part B, 2015, 80: 82 DOI:10.1016/j.trb.2015.06.010 [16] US Department of Transportation. NGSIM-next generation SIMulation[EB/OL].[2017-10-30]. https://data.transportation.gov/Automobiles/Next-Generation-Simulation-NGSIM-Vehicle-Trajector/8ect-6jqj. [17] FAN Jianqing, YAO Qiwei. Nonlinear time series: nonparametric and parametric methods[M]. New York: Springer, 2003 [18] GHAHRAMANI Z, BEAL M. Propagation algorithms for variational Bayesian learning[J]. Advances in Neural Information Processing Systems, 2001, 13: 507 [19] GELMAN A, CARLIN J B, STERN H S, et al. Bayesian data analysis[M]. London: Chapman & Hall, 2004 [20] GHAHRAMANI Z, HINTON G. Variational learning for switching state-space models[J]. Neural Computation, 2000, 12(4): 831 DOI:10.1162/089976600300015619 [21] 周商吾. 交通工程[M]. 上海: 同济大学出版社, 1987 ZHOU Shangwu. Traffic engineering[M]. Shanghai: Tongji University Press, 1987 [22] MA Wanjing, AN Kun, LO H K. Multi-stage stochastic program to optimize signal timings under coordinated adaptive control[J]. Transportation Research Part C, 2016, 72: 342 DOI:10.1016/j.trc.2016.10.002 [23] DAGANZO C F. The cell transmission model: a dynamic representation of highway traffic consistent with the hydrodynamic theory[J]. Transportation Research Part B, 1994, 28(4): 269 DOI:10.1016/0191-2615(94)90002-7 [24] DAGANZO C F. The cell transmission model part Ⅱ: network traffic[J]. Transportation Research Part B, 1995, 29(2): 79 DOI:10.1016/0191-2615(94)00022-R [25] WU Xinkai, LIU Henry. A shockwave profile model for traffic flow on congested urban arterials[J]. Transportation Research Part B, 2011, 45: 1768 DOI:10.1016/j.trb.2011.07.013 [26] ZHANG Nan, YANG Xiaoguang, MA Wanjing. Empirical approximation for the stochastic fundamental diagram of traffic flow on signalized intersection[J]. Journal of Advanced Transportation, 2018 DOI:10.1155/2018/4603614 [27] GHAHRAMANI Z. An introduction to hidden Markov models and Bayesian networks[J]. International Journal of Pattern Recognition and Artificial Intelligence, 2001, 15(1): 9 [28] CAPP O, MOULINES E, RYDEN T. Inference in hidden Markov models[M]. New York: Springer, 2007 [29] BEAL M, GHAHRAMANI Z, Rasmussen C E. The infinite hidden Markov model[J]. In Advances in Neural Information Processing Systems, 2002, 14: 577