非参数检验及matlab实现
Kolmogorov-Smirnov test:
检验两个样本是否有相同分布
Kstest
Test statistics:()
-
max()()
F x
G x
[h,p,ksstat,cv] = kstest(x,CDF,alpha,type)
x:被测试的数据样本,以列向量输入(continuous distribution defined by cumulative distribution function)
CDF:被检验的样本cumulative distribution function,缺省值为
N(0,1)
Alpha:显著性水平,缺省时为0.05
Type:字符输入。'unequal'(缺省值)检验两者分布是否相同
'larger' 检验x的CDF大于给定的CDF
'smaller' 检验x的CDF小于给定的CDF
h h=0不拒绝原假设,即两个分布相同
h=1拒绝原假设,即两个分布不同
p :拒绝原假设的最小显著性水平
ksstat :假设为真时,满足student分布
cv :critical value/cutoff value,determining if ksstat is significant.
Kstest2:
[h,p,ks2stat] = kstest2(x1,x2,alpha,type)