金融时间序列分析:8. MA模型实例(Python)
来源:互联网 发布:thunder mac 2.7.8 编辑:程序博客网 时间:2024/04/29 21:33
0. 目录
金融时间序列分析:9. ARMA自回归移动平均模型
金融时间序列分析:8. MA模型实例(Python)
金融时间序列分析:7. MA滑动平均模型
金融时间序列分析:6. AR模型实例
金融时间序列分析:5. AR模型实例(Python)
金融时间序列分析:4. AR自回归模型
金融时间序列分析:3. First Demo By Python
金融时间序列分析:2. 数学分析模型
金融时间序列分析:1. 基础知识
1. 前言
数据获取,预处理,定阶什么的参考前面几篇文章:
[金融时间序列分析:3. First Demo By Python]
[金融时间序列分析:5. AR模型(Python)]
MA模型的讲解参考前文:
[金融时间序列分析:7. MA滑动平均模型]
2. 建模与分析预测
这个和以前那个AR模型基本一样,我也不多说了。
print '---------------------------MA TEST------------------------------' adf_res = adf_test(ts_diff['2014-01-01':'2015-12-31']) print 'ADF test results (ema diff):\n', adf_res ma_predict = draw_ma(ts_diff['2014-01-01':'2015-12-31'], int(adf_res['Lags Used'])) rtn_test(ma_predict, "ma predict")
def draw_ma(ts, w): ma = ARMA(ts, order=(0, w)).fit(disp = -1) ts_predict_ma = ma.predict() ar = ARMA(ts, order=(w,0)).fit(disp=-1) ts_predict_ar = ar.predict() plt.clf() plt.plot(ts_predict_ar, label="AR") plt.plot(ts_predict_ma, label="MA") #plt.plot(ts, label = "ORG") plt.legend(loc="best") plt.title("MA Test %s" % w) plt.savefig("./PDF/test_ma_"+ str(w) +".pdf", format='pdf') return ts_predict_ma
结果如下:
3. 预测数据分析
原始数据
abs mean : 0.0118623137237
std var : 0.0172625800497
Minimum value is: -0.0925615434824
Maximum value is: 0.0903425141497
Arithmetic mean is: 0.000195754536494
Unbiased variance is: 0.000297996669973
Biased skewness is: -0.479992664412
Biased kurtosis is: 3.92636403052
AR预测数据
abs mean : 0.00363097137215
std var : 0.00522169036148
Minimum value is: -0.0273872869419
Maximum value is: 0.0262852580925
Arithmetic mean is: 0.0010682950804
Unbiased variance is: 2.72660502312e-05
Biased skewness is: -0.391757274581
Biased kurtosis is: 4.91810357904
MA预测数据
abs mean : 0.00314592965807
std var : 0.00438791465633
Minimum value is: -0.0223893454803
Maximum value is: 0.0186398706818
Arithmetic mean is: 0.00106361911149
Unbiased variance is: 1.92537950312e-05
Biased skewness is: -0.59323473066
Biased kurtosis is: 3.99711788068
- 金融时间序列分析:8. MA模型实例(Python)
- 金融时间序列分析:5. AR模型实例(Python)
- 金融时间序列分析:7. MA滑动平均模型
- 金融时间序列分析: 10. ARMA模型实例(R,Python)
- 时间序列分析这件小事(五)--MA模型
- 时间序列分析之AR模型、MA模型和ARMA模型(二)
- 金融时间序列分析:6. AR模型实例(R语言)
- 金融时间序列分析:2. 数学分析模型
- matlab之 时间序列MA(q)模型
- 时间序列之MA(滑动平均模型)
- [时间序列分析][4]--AR模型,MA模型,ARMA模型介绍
- 金融时间序列分析:11. 模型分析小结
- 数据分析技术:时间序列分析的AR/MA/ARMA/ARIMA模型体系
- 金融时间序列分析:4. AR自回归模型
- 金融时间序列分析:3. First Demo By Python
- 如何判断时间序列AR(p)和MA(q)模型
- Python时间序列分析--从线性模型到GARCH模型
- 金融时间序列分析:9. ARMA自回归移动平均模型
- img的src如果加载失败后样式的一些解决方案
- Androidrecovery模式(1)—功能和如何进入
- 匹配printf()说明符的类型
- expandableListView如何实现滑动时自动展开
- 大数据量远程同步
- 金融时间序列分析:8. MA模型实例(Python)
- 【linux】vim插件的安装
- android NFC的使用
- 那些Python方法---reduce()
- 【PHP兴趣部落-06】PHP日期和时间
- android的消息处理机制(图+源码分析)——Looper,Handler,Message
- Java API:String类
- so链接.a问题
- scala的主构造函数