总算明白了Q-Q plot

188 篇文章 17 订阅

QQ图几年前就听过,但不知道代表什么,也没有动力去弄明白,现在明白了;Q代表quantile,图上的每一个点有个内在属性,就是两组数据的分位点是相同的;比如说某个点是数据集1的上四分位点,那么也一定是数据集2的上四分位点;
The quantile-quantile (q-q) plot is a graphical technique for determining if two data sets come from populations with a common distribution; 

由此可以推断:两个数据集的数据一定是排好序的;

QQ图还会有一个直线进行对比;
A 45-degree reference line is also plotted. If the two sets come from a population with the same distribution, the points should fall approximately along this reference line. The greater the departure from this reference line, the greater the evidence for the conclusion that the two data sets have come from populations with different distributions.
sample quantile-quantile plot

使用案例:

import tushare as ts
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data=ts.get_k_data('002230')
#data[['close','open']].hist(bins=30,figsize=(15,8))

import scipy.stats as stats
N = 1200
p = 0.53
q = 1000
obs = np.random.binomial(N, p, size = q)/N
z = (obs-np.mean(obs))/np.std(obs)

stats.probplot(data['open'], dist="norm", plot=plt)
plt.title("Normal Q-Q plot")
plt.show()

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值