- https://blog.csdn.net/ZVAyIVqt0UFji/article/details/81784639
周期时间序列的预测
(有python代码)
具有周期性特征的序列需要将周期性特征提取出来。python里面的statsmodels工具包里面有针对周期性分解的函数seasonal_decompose,我们可以将序列进行分解。seasonal_decompose这个函数里面有个two_sided的参数,默认是True。Trend处理的时候用到移动平均的方法,熟悉此方法的读者就会发现,经过该方法处理以后,序列收尾两段有一部分数据缺失了,但是如果该参数为FALSE,则只有开始的时候有一段缺失值。
-
时间序列的一些理论?
https://wiki.mbalib.com/wiki/时间序列预测法
https://blog.csdn.net/webzjuyujun/article/details/50618617 http://www.faushine.com/2018/09/30/2018-10-01-time-serise-forecasting/http://www.faushine.com/2018/09/30/2018-10-01-time-serise-forecasting/ -
Facebook 时间序列预测算法 Prophet 的研究
https://zhuanlan.zhihu.com/p/52330017 -
知乎的一些回答(回头再看)
https://www.zhihu.com/question/21229371 -
https://juejin.im/entry/5bba1af56fb9a05ce469df75
多变量时间序列的预测和建模指南(附Python代码) -
https://www.leiphone.com/news/201702/QjrKc9cLWAiqRGhT.html
时间序列预测教程:如何利用 Python 预测波士顿每月持械抢劫案数量?
里面有很多分析手法
ARIMA
判断p, d, q
d是差分
如果不用差分就是平稳的,那么d是0
如果是一阶差分才平稳,那d是1.ts_diff_1 = ts.diff(1)
。。。。
p,q的选择有:
- arma_order_select_ic
- 画画出ACF,PACF的图像
#https://blog.csdn.net/u012735708/article/details/82460962
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
def draw_acf_pacf(ts,lags):
f = plt.figure(facecolor='white')
ax1 = f.add_subplot(211)
plot_acf(ts,ax=ax1,lags=lags)
ax2 = f.add_subplot(212)
plot_pacf(ts,ax=ax2,lags=lags)
plt.subplots_adjust(hspace=0.5)
plt.show()
draw_acf_pacf(ts_diff_2,30)
https://blog.csdn.net/duxu24/article/details/52079901
seasonal_decompose
https://blog.csdn.net/ZVAyIVqt0UFji/article/details/81784639
https://blog.csdn.net/u012735708/article/details/82460962
https://blog.csdn.net/u011596455/article/details/78650517
https://blog.csdn.net/shine19930820/article/details/72667656
https://www.jianshu.com/p/09e5218f58b4
https://www.biaodianfu.com/time-series-forecasting-codes-python.html (这篇感觉很详细!)
test
trainfile2.csv
date_time,pop
2018-11-12 00:00:00,8933.946387360553
2018-11-12 01:00:00,8988.490918493022
2018-11-12 02:00:00,9094.357585159689
2018-11-12 03:00:00,8988.490918493022
2018-11-12 04:00:00,8988.490918493024
2018-11-12 05:00:00,9074.14913063393
2018-11-12 06:00:00,10789.571764691244
2018-11-12 07:00:00,17151.58225829059
2018-11-12 08:00:00,34289.93003731031
2018-11-12 09:00:00,48453.44305799665
2018-11-12 10:00:00,55580.46013546843
2018-11-12 11:00:00,55285.64358646245
2018-11-12 12:00:00,53865.35841064149
2018-11-12 13:00:00,50751.98869523418