Shingrace的个人博客分享 http://blog.sciencenet.cn/u/Shingrace

博文

python 统计方法-分布检验

已有 4726 次阅读 2016-12-14 22:01 |个人分类:python|系统分类:科研笔记

import scipy

scipy.stats.ttest_rel()  

Examples for the use are scores of the same set of student in

   different exams, or repeated sampling from the same units.


scipy.stats.kstest()

   This performs a test of the distribution G(x) of an observed

   random variable against a given distribution F(x)

#例子(1)

from scipy import stats

import numpy as np


x = np.linspace(-15, 15, 9)

D,p = scipy.stats.kstest(x, 'norm')

#(D=0.44435602715924361, p=0.038850142705171065)

#默认two-sided检验,p值太小,x不是norm分布



scipy.stats.ks_2samp()

   This tests whether 2 samples are drawn from the same distribution.

http://www.physics.csbsju.edu/stats/KS-test.html



https://wap.sciencenet.cn/blog-669638-1020758.html


下一篇:python-符号运算(求导等)
收藏 IP: 36.110.120.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-1 06:51

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部