交通预测模型和实现

主要模型及应用 1. ARIMA 2. LSTM  GRU 

1 ARIMA模型

As early as 1976, Box and Jenkins[1] proposed the Autoregressive Integrate Moving Average Model (ARIMA).  In 1995, Hamed et al[2] used the ARIMA model to predict the traffic volume in urban arterials.  To improve the prediction precision of the model, different variants were produced, including Kohonen ARIMA[3], subset ARIMA [4], seasonal ARIMA [5], and so on.These models are based on the assumption of stationary variance and mean of the time series.

[1] M. S. Ahmed and A. R. Cook, “Analysis of freeway traffic time-series data by using Box-Jenkins techniques,” Transp. Res. Rec., no. 722, pp. 1–9, 1979.

[2] M. M. Hamed, H. R. Al-Masaeid, and Z. M. B. Said, “Short-term prediction of traffic volume in Urban arterials,” J. Transp. Eng., vol. 121, no. 3, pp. 249–254, 1995.

[3] M. van der Voort, M. Dougherty, and S. Watson, “Combining kohonen maps with ARIMA time series models to forecast traffic flow,” Transp. Res. C, Emerg. Technol., vol. 4, no. 5, pp. 307–318, 1996.

[4]  S. Lee and D. Fambro, “Application of subset autoregressive integrated moving average model for short-term freeway traffic volume forecasting,” Transp. Res. Rec., J. Transp. Res. Board, vol. 1678, no. 1, pp. 179–188, 1999.

[5]  B. M. Williams and L. A. Hoel, “Modeling and forecasting vehicular traffic flow as a seasonal ARIMA process: Theoretical basis and empirical results,” J. Transp. Eng., vol. 129, no. 6, pp. 664–672, Nov. 2003.

1.1 概念

       求和自回归移动平均模型,(Autoregressive Integrated Moving Average Model,ARIMA),记作ARIMA(p,d,q),是统计模型中最常见的时间序列预测模型。

交通预测模型和实现_第1张图片

交通预测模型和实现_第2张图片

ARIMA可以拆分为AR, I, MA,分别对应p, d, q三个参数。

① AR(AutoRegressive)描述当前值与历史值关系,用变量自身的历史时间数据对自身进行预测,自回归过程的公式定义: yt是当前值 μ是常数项 p是阶数 γi是自相关系数εt是误差。p为自回归模型阶数。

② I(Integrated )表差分,时间序列剔除周期性因素的方法,主要是对等周期间隔的数据进行线性求减,使数据变平稳,ARIMA一般进行一次差分即可稳定,因此d一般取值为0、1、2。

③ MA(Moving Average)利用一定时间间隔内的平均值作为某一期估计值,以消除数据周期性影响。q为移动平均的阶数。

1.2 表达式及参数    

ARIMA(p,d,q)    

p:模型采用的时序数据本身的滞后数(lags) ,即AR/Auto-Regressive项,自回归多项式阶数, p是自回归参数的阶数。    

d:时序数据变稳的差分阶数,即Integrated项    

q:模型中采用的预测误差的滞后数(lags),即MA/Moving Average项,移动平均多项式阶数,移动平均参数阶数。

1.3 ARIMA建模步骤

1)获取被观测系统时间序列数据;

2)对数据绘图,观测是否为平稳时间序列;对于非平稳时间序列要先进行d阶差分运算,化为平稳时间序列;

3)分别求平稳时间序列自相关系数ACF 和偏自相关系数PACF,分析自相关图和偏自相关图,得到最佳的 p 和 q值;

4)由以上得到的d、q、p,得到ARIMA模型。然后开始对得到的模型进行模型检验。 优缺点     优点: 模型简单,不需借助外生变量。    

缺点:时序数据是稳定的,或通过差分后是稳定的;只能捕捉线性关系,而不能捕捉非线性关系。系统模型是静态的,不能反映非线性的假设 以及交通数据的不确定性,无法克服交通事故等随机事件的干扰。

交通预测模型和实现_第3张图片交通预测模型和实现_第4张图片

交通预测模型和实现_第5张图片

交通预测模型和实现_第6张图片

2 LSTM GRU

2.1 LSTM(long short-term memory)

LSTM[1] was proposed for language models in 1997 and was utilized for traffic flow prediction since 2015. LSTM (Ma et al[2]. 2015) show more superior performance in capturing temporal correlations in traffic conditions, compared with traditional time series methods (e.g., ARIMA (Makridakis and Hibon [3]1997)) and machine learning models (e.g., support vector regression (SVR) (Wu,Ho, and Lee[4] 2004), k-nearest neighbor (KNN) (Zheng and Su[5] 2014). LSTM NN are to model long-term dependencies and determine the optimal time lag for time series problems[2].

[1] Hochreiter S, Schmidhuber J. Long Short-term memory[J]. Neural Computation, 1997,9(8):1735-1780. [2] X. Ma, Z. Tao, Y. Wang, H. Yu and Y. Wang, "Long short-term memory neural network for traffic speed prediction using remote microwave sensor data," Transp. Res. C, Emerging Technologies, vol. 54, pp. 187-197, May 2015. [3] Makridakis, S., and M. Hibon. 1997. “ARMA Models and the Box-Jenkins Methodology.” Journal of Forecasting 16: 147–163. [4] Wu, C.-H.; Ho, J.-M.; and Lee, D. T. 2004. Travel-time prediction with support vector regression. IEEE Transactions on Intelligent Transportation Systems 5(4):276–281. [5] Zheng, Z., and Su, D. 2014. Short-term traffic volume forecasting: A k-nearest neighbor approach enhanced by constrained linearly sewing principle component algorithm. Transportation Research Part C: Emerging Technologies 43:143–157.

2.1.1 RNN网络结构

交通预测模型和实现_第7张图片

2.1.2 LSTM网络结构

交通预测模型和实现_第8张图片

交通预测模型和实现_第9张图片

2.1.3 LSTM优缺点              

优点:Long Short-Term Neural Network(LSTM NN)模型可以捕捉非线性的动态变化。LSTM NN模型克服了梯度下降过程中梯度消失的缺点,因此对于长时间依赖的时间序列数据展现出格外优越的性能。         缺点:结构复杂

2.2 GRU(Gated Recurrent Unit )

Due to LSTM complex structure, the solution to LSTM NNs usually takes long time. To speed up training, in 2014, GRU[1] was proposed as a modification for LSTM to do machine translation, for its simpler structure and convenience to solve [2].

[1] Chung, J.; Gulcehre, C.; Cho, K.; and Bengio, Y. 2014. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. In NIPS 2014 Workshop on Deep Learning. [2] K. Cho, B. van Merrienboer, C. Gulcehre, F. Bougares, H. Schwenk, D. Bahdanau, and Y. Bengio, "Learning phrase representations using RNN encoder-decoder for statistical machine translation," arXiv preprint arXiv:1406.1078, 2014.

2.2.1 GRU网络结构        

GRU由 Cho, et al. (2014)[1] 提出,是一个改动比较大的变体。它保持了LSTM的效果又使结构更加简单计算量更小。GRU用update gate替代LSTM中的。 把cell state Ct和隐状态ht进行合并。

交通预测模型和实现_第10张图片

[1] Chung, J.; Gulcehre, C.; Cho, K.; and Bengio, Y. 2014. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. In NIPS 2014 Workshop on Deep Learning.

交通预测模型和实现_第11张图片

运行结果:

交通预测模型和实现_第12张图片

交通预测模型和实现_第13张图片

LSTM NN模型结构图

交通预测模型和实现_第14张图片

交通预测模型和实现_第15张图片

GRU NN模型结构图

交通预测模型和实现_第16张图片

你可能感兴趣的:(arima,lstm,gru,机器学习)