python-33品种期货自相关系数
来源:互联网 发布:p2摄像机采集软件 编辑:程序博客网 时间:2024/04/26 00:46
# -*- coding: utf-8 -*-"""Created on Thu Jun 22 17:03:16 2017@author: yunjinqi E-mail:yunjinqi@qq.com Differentiate yourself in the world from anyone else."""import pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport statsmodels.tsa.stattools as tsimport statsmodels.api as smfrom statsmodels.graphics.api import qqplotnamelist=['cu','al','zn','pb','sn','au','ag','rb','hc','bu','ru','m9','y9','a9', 'p9','c9','cs','jd','l9','v9','pp','j9','jm','i9','sr','cf', 'zc','fg','ta','ma','oi','rm','sm']j=0for i in namelist: filename='C:/Users/HXWD/Desktop/数据/'+i+'.csv' data=pd.read_csv(filename,encoding='gbk') data.columns=['date','open','high','low','close','amt','opi'] data.head() data=np.log(data['close']) r=data-data.shift(1) r=r.dropna() #print(r) x = np.array(r) print(i) lag_acf = acf(x, nlags=40) lag_pacf = pacf(x, nlags=40, method='ols') fig = plt.figure(figsize=(12,8)) ax1=fig.add_subplot(211) print(lag_acf) fig = sm.graphics.tsa.plot_acf(x,lags=40,ax=ax1) ax2 = fig.add_subplot(212) print(lag_pacf) fig = sm.graphics.tsa.plot_pacf(x,lags=40,ax=ax2) plt.show()
33期货品种指数的对数收益率的自相关检验,基本上不存在自相关。
阅读全文
0 0
- python-33品种期货自相关系数
- python-优矿-hurst指数与期货33品种的预测
- python-33品种随机游走检验
- python 相关系数
- 期货多品种多策略多周期组合
- python-检验33品种数据是否是正态分布
- [转]自相关系数
- python计算相关系数
- python计算相关系数
- [时间序列分析][3]--自相关系数和偏自相关系数
- 自相关系数的一些问题
- 联播大业王恒:国债期货上市后的三种股票有望成为流行品种
- 【原创】从文华财经下载数据并且分析每个期货品种的贝塔值-云金杞
- Python+pandas计算数据相关系数
- 期货
- 期货
- 期货
- 期货
- java url处理常遇到的问题
- Token验证详解
- CountDownLatch同步计数器
- SpringBoot+Dubbo学习心得
- DRUID- metabase安装使用
- python-33品种期货自相关系数
- 线程池的创建 完整c代码
- C++ 浅拷贝/深拷贝
- 利用数据库存储订单、通知和任务,构建高性能队列
- js部分知识整理,google浏览器的代码调试
- 装饰者模式
- CSS基础选择器测试用例
- 公共基因表达数据分析系统genevestigator,再也不愁表达数据的查询和比较了
- PHP获取用户访问IP地址的5种方法