python-33品种随机游走检验
来源:互联网 发布:linux oracle em 启动 编辑:程序博客网 时间:2024/04/20 09:07
# -*- 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 qqplotfrom statsmodels.sandbox.stats.runs import runstest_1sampnamelist=['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) x[x>=0]=1 x[x<0]=0 t=runstest_1samp(x) if abs(t[0])<1.96 and t[1]>0.05: print('{}该收益序列属于随机游走'.format(i))
结果:
sn该收益序列属于随机游走
rb该收益序列属于随机游走
hc该收益序列属于随机游走
cs该收益序列属于随机游走
jd该收益序列属于随机游走
l9该收益序列属于随机游走
pp该收益序列属于随机游走
j9该收益序列属于随机游走
jm该收益序列属于随机游走
i9该收益序列属于随机游走
zc该收益序列属于随机游走
ta该收益序列属于随机游走
ma该收益序列属于随机游走
oi该收益序列属于随机游走
rm该收益序列属于随机游走
sm该收益序列属于随机游走
阅读全文
0 0
- python-33品种随机游走检验
- python-检验33品种数据是否是正态分布
- python局部随机游走LRW
- 随机游走
- 随机游走
- python-33品种期货自相关系数
- 量子随机游走
- 浅谈随机游走
- 随机游走图像分割
- 【jzoj4890】【随机游走】
- JZOJ4890. 随机游走
- 随机游走ah
- randomwalk随机游走
- Jzoj4890 随机游走
- python-优矿-hurst指数与期货33品种的预测
- 随机游走的期望距离
- 随机游走的期望距离
- (未完成)随机游走模型
- vim下中文乱码问题
- bp实现手写识别
- CMAKE手册
- HTML5中的数据集dataset和自定义属性data-*
- 逆变
- python-33品种随机游走检验
- C#获取程序运行时间
- 【大数据部落】R语言对推特数据进行文本情感分析
- 对底层寻址的理解
- 输入流和输出流
- 最简单的基于FFmpeg的封装格式处理:视音频分离器简化版(demuxer-simple)
- 算法导论-插入排序 insertion sort
- 关于数据库如何分表
- 感想篇:4)越来越精简的机械设计