科学网—python 统计方法

  • 时间:
  • 浏览:11
  • 来源:SSYCMS

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

http://blog.sciencenet.cn/blog-669638-1020758.html

上一篇:读罗老师的文章,真过瘾,哈哈

下一篇:

python-符号运算(求导等)