24小时热门版块排行榜    

CyRhmU.jpeg
查看: 2549  |  回复: 9

monitor2885

至尊木虫 (职业作家)

队长

[求助] 数据是否符合正态分布

s=[1.43;1.48;1.15;1.57;1.96;3.46;3.49;1.35;2.17;2.4;2.43;2.68;2.38;1.43;1.42;1;1.24;1.59;1.67;1.32;2.43];
kurtosis(s)/std(s)
ans =
    4.0153

百度上说,峰度系数与其标准误的比值用来检验正态性。如果该比值绝对值大于2,将拒绝正态性。但是经过kstest测试,数组s符合正态分布呀。请问,怎么回事?
回复此楼
Retirement
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

monitor2885

至尊木虫 (职业作家)

队长

有人会吗?
Retirement
2楼2011-08-06 07:41:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lijinfeng042

木虫 (小有名气)

Matlab

【答案】应助回帖

★ ★ ★
monitor2885(金币+5): CDF是什么呢? 2011-08-06 11:09:00
臭水沟(金币+3): 谢谢应助~~ 2011-08-06 13:15:17
>> s=[1.43;1.48;1.15;1.57;1.96;3.46;3.49;1.35;2.17;2.4;2.43;2.68;2.38;1.43;1.42;1;1.24;1.59;1.67;1.32;2.43];
>> p_judge(s,0.05)

H1 =

     0


s1 =

    0.3186

该数据源服从正态分布。

H2 =

     0


s2 =

    0.4848

该数据源服从γ分布。

H3 =

     1


s3 =

  4.4963e-004

该数据源不服从泊松分布。

H4 =

     1


s4 =

    0.0011

该数据源不服从指数分布。

phat =

    1.4361


pci =

    1.1841
    1.8253


H5 =

     0


s5 =

    0.1979

该数据源服从rayleigh分布。
>>
进一步的看看
>> [h,p,istat,cv]=lillietest(s,0.05)

h =

     1


p =

    0.0253


istat =

    0.2013


cv =

    0.1877


很明显拒绝原假设;即 数据在0.05的置信水平下不是正态分布;承认原假设的概率为2.53%左右
>> subplot(211)
>> normplot(s)
>> subplot(212)
>> hist(s)

由图形可以明显看出,不服从分布检验的

所以我去查看了kstest 的帮助文档 终于知道为什么了:这个函数本来就不适合做正态分布的检验.原文是:
The Kolmogorov-Smirnov test requires that CDF be predetermined. It is not accurate if CDF is estimated from the data. To test x against a normal distribution without specifying the parameters, use lillietest instead.
工作了,偶尔会上来~可以关注新浪微博 @云是风的梦_Matlab
3楼2011-08-06 09:23:47
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lijinfeng042

木虫 (小有名气)

Matlab

【答案】应助回帖


monitor2885(金币+2): 2011-08-06 11:29:09
臭水沟(金币+1): 谢谢应助~~ 2011-08-06 13:15:57
附图
工作了,偶尔会上来~可以关注新浪微博 @云是风的梦_Matlab
4楼2011-08-06 09:40:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

monitor2885

至尊木虫 (职业作家)

队长

The Kolmogorov-Smirnov test requires that CDF be predetermined. It is not accurate if CDF is estimated from the data. To test x against a normal distribution without specifying the parameters, use lillietest instead.

给翻译一下呗,CDF啥意思呢?什么情况下kstest可以检测数据是否正态分布?
Retirement
5楼2011-08-06 11:12:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lijinfeng042

木虫 (小有名气)

Matlab

【答案】应助回帖

★ ★ ★
臭水沟(金币+3): 谢谢应助~~ 2011-08-06 13:19:00
monitor2885(金币+3): 2011-08-06 14:03:38
引用回帖:
5楼: Originally posted by monitor2885 at 2011-08-06 11:12:31:
The Kolmogorov-Smirnov test requires that CDF be predetermined. It is not accurate if CDF is estimated from the data. To test x against a normal distribution without specifying the parameters, use  ...

呃 兄弟不是吧 偶的英语啊 惨不忍睹啊
help kstest 就可以看见具体的了
更进一步的解释是
The function KSTEST by default, performs a two-tailed test. In case of such tests, if the significance level is alpha (0.05 by default), the null hypothesis is rejected if the P-value is less than alpha/2. To account for the tail in the computations, you have to specify the 4th input to the KSTEST function ('tail').
默认的是5%水平的双边检验 在缺省条件下, 如果P值小于α/ 2,零假设被拒绝...CDF啊,那个是一个分布概率啊 你看看kstest的用法就明白了
CODE:
A=A(:);
[mu,sigma]=normfit(A);
p1=normcdf(A,mu,sigma);
[H1,s1]=kstest(A,[A,p1],alpha)

工作了,偶尔会上来~可以关注新浪微博 @云是风的梦_Matlab
6楼2011-08-06 13:16:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

monitor2885

至尊木虫 (职业作家)

队长

引用回帖:
6楼: Originally posted by lijinfeng042 at 2011-08-06 13:16:48:
呃 兄弟不是吧 偶的英语啊 惨不忍睹啊
help kstest 就可以看见具体的了
更进一步的解释是
The function KSTEST by default, performs a two-tailed test. In case of such tests, if the significance level ...

kstest不适合检验数据的正态分布吗?这个函数没什么用处了?
lillietest就合适?
Retirement
7楼2011-08-06 14:20:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lijinfeng042

木虫 (小有名气)

Matlab


臭水沟(金币+1): 谢谢应助~~ 2011-08-07 12:35:57
引用回帖:
7楼: Originally posted by monitor2885 at 2011-08-06 14:20:05:
kstest不适合检验数据的正态分布吗?这个函数没什么用处了?
lillietest就合适?

继续help 按照说明就是这个样子 至于更详细的原理  看看edit kstest
Kolmogorov-Smirnov 的方法我是没有必要研究的 感兴趣你可以看看
工作了,偶尔会上来~可以关注新浪微博 @云是风的梦_Matlab
8楼2011-08-07 09:23:15
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

monitor2885

至尊木虫 (职业作家)

队长

到底我的这组数据符不符合正态分布啊
Retirement
9楼2011-10-20 03:37:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

monitor2885

至尊木虫 (职业作家)

队长

到底我的这组数据符不符合正态分布啊
Retirement
10楼2011-12-19 11:32:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 monitor2885 的主题更新
信息提示
请填处理意见