为什么测试分布时 p 值为 0
我想测试样本的分布,我尝试了一些测试,例如kstest。但我总是得到 p-value=0 的结果。为什么?
I wanna test the distribution of a sample, I have tried several test like kstest. But I always got the result of p-value=0. Why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您执行统计检验时,您有两个假设:
小的 p 值 表明观察结果与原假设不一致。使用的典型短语是“我们拒绝原假设”。这意味着您的数据似乎不正常。
其他一些指示。
When you perform a statistical test, you have two hypothesis:
A small p-value indicates that the observations are inconsistent with the Null hypothesis. The typical pharse used is, "we reject the null hypothesis". That means that your data doesn't seem to be normal.
A few other pointers.
也许您忘记了这一点:Matlab 不会返回测试的 p 值! Matlab中测试的标准输出是0-1输出! 1 表示在 5% 显着性水平上拒绝原假设,0 表示在 5% 显着性水平上未能拒绝原假设。如果您对 p 值感兴趣,只需执行以下操作:
[H,P] = KSTEST(...) 还会返回渐近 P 值 P。H
是 0-1 变量(如果您不这样做,则为标准输出)不要命名任何变量),P 是您的 p 值。
Maybe you forgot this: Matlab does NOT return the p-value for a test! The standard output of testing in Matlab is a 0-1 output! 1 indicates a rejection of the null hypothesis at the 5% significance level, 0 indicates a failure to reject the null hypothesis at the 5% significance level. If you are interested in your p-value, just do this:
[H,P] = KSTEST(...) also returns the asymptotic P-value P.
H is the 0-1 variable (and the standard output if you don't name any variables) and P is your p-value.
一般来说,较小的p 值是理想的。 p 值越小,拒绝原假设的可能性就越大。例如,在函数 KSTEST 的情况下,一个非常小的 p-值将非常重要地表明您正在测试的数据分布不遵循标准正态分布(即原假设)。
如果您总是得到恰好零,而不仅仅是显示时四舍五入的非常小的值,您可能需要检查统计函数失败的可能性并返回垃圾结果。以下是一些需要注意的事项:
In general, smaller p-values are desirable. The smaller the p-value, the more certainty there is that the null hypothesis can be rejected. For example, in the case of the function KSTEST a very small p-value would indicate with a great deal of significance that the data distribution you are testing does not follow a standard normal distribution (i.e. the null hypothesis).
If you are always getting exactly zero, and not just really small values that are being rounded off when displayed, you may want to check for the possibility that the statistical functions are failing and returning garbage results. Here are some things to look for: