# times_series **Repository Path**: xiwanggit/times_series ## Basic Information - **Project Name**: times_series - **Description**: 时序建模:对铁路货运量/客运量进行时序建模预测 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 12 - **Forks**: 5 - **Created**: 2020-07-01 - **Last Updated**: 2025-04-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README * 目的:对铁路货运量进行时序建模预测 * code * Python: 3.7 * run.py:程序入口 * model_evalute.py:模型评估 * algorithm * line_model.py:简单线性模型 * stl_model.py:STL模型 * holt_winters_damp_model.py:holt-winter 阻尼季节性模型 * arma_arima_model.py:ARMA & ARIMA模型 * R: 4.0.2 * run.R:程序入口 * package prophet(by facebook): support R & Python. * [Github](https://github.com/facebook/prophet) * [API](https://facebook.github.io/prophet/docs/quick_start.html) * 理论 * [王燕 应用时间序列分析 第三版](https://gitee.com/xiwanggit/book-math/blob/master/note/%E5%BA%94%E7%94%A8%E6%97%B6%E9%97%B4%E5%BA%8F%E5%88%97%E5%88%86%E6%9E%90.md) * [预测:方法与实战](https://gitee.com/xiwanggit/book-math/blob/master/note/%E9%A2%84%E6%B5%8B%EF%BC%9A%E6%96%B9%E6%B3%95%E4%B8%8E%E5%AE%9E%E6%88%98.md) * [note](https://gitee.com/xiwanggit/times_series/blob/master/note.md) * 过程 * 数据探索:铁路货运量数据 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0720/171744_b415285e_379161.png "数据探索.png") * 简单线性回归 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0720/171812_44e4cae5_379161.png "简单线性回归.png") * 时序分解:STL模型:看起来还行,但残差并不是白噪音 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0720/171846_086d8301_379161.png "STL模型.png") * 指数平滑:Holt-Winters阻尼趋势模型:同STL ![输入图片说明](https://images.gitee.com/uploads/images/2020/0720/172000_e6714340_379161.png "Holt-Winters阻尼季节性模型.png") * ARMA模型 * 二次差分 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0720/172120_7645f1d5_379161.png "二次差分ARMA模型.png") * 月度差分(diff(12)) ![输入图片说明](https://images.gitee.com/uploads/images/2020/0720/172130_3f4daa1d_379161.png "月度差分ARMA模型.png") * 非季节性ARIMA模型与二次差分模型极度相似 * 季节性ARIMA模型 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0729/133501_96d25f8f_379161.png "SARIMA模型.png") * 一层LSTM ![输入图片说明](https://images.gitee.com/uploads/images/2020/1006/075903_41d5197b_379161.png "一层LSTM.png") * 一层GRU ![输入图片说明](https://images.gitee.com/uploads/images/2020/1006/075915_a501bc91_379161.png "一层GRU.png") * 评估指标 | 序号 | 模型 | mae | mape | rmse | |---|---|---|---|---| | 1 | STL | 1708.587890625 | 4.75034999847412 | 1843.4534912109375 | | 2 | Holt-Winters阻尼趋势 | 1760.7532958984375 | 4.894587993621826 | 1995.978759765625 | | 3 | ARMA-二次差分 | 2923.4296485428586 | | 3265.973788764896 | | 4 | ARMA-月度差分 | 1398.5633840690107 | | 1656.7750122665723 | | 5 | 季节性ARIMA | 1172.88818359375 | 3.175144910812378 | 1496.1046142578125 | | 6 | LSTM | 2685.266845703125 | 7.491035461425781 | 3051.925537109375 | | 7 | GRU | 2669.312255859375 | 7.446711540222168 | 3031.5517578125 |