||
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
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-1 06:51
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社