为什么测试分布时 p 值为 0

发布于 2024-10-12 15:58:31 字数 60 浏览 13 评论 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

关于从前 2024-10-19 15:58:31

当您执行统计检验时,您有两个假设:

  • 原假设。经常调用H_0。在您的情况下,零假设是数据来自正态分布。
  • 替代假设。经常调用H_1或H_A。就您而言,数据来自非正态分布。

小的 p 值 表明观察结果与原假设不一致。使用的典型短语是“我们拒绝原假设”。这意味着您的数据似乎不正常。

其他一些指示。

  1. 将数据绘制为直方图。然后叠加一个均值和方差等于数据的正态密度。看起来相似吗?
  2. 为什么您的数据是否正常很重要?
  3. 统计问题最好在 statistics stackexchange 站点上提出。
  4. 有关更多详细信息,请参阅维基百科正态性测试页面。

When you perform a statistical test, you have two hypothesis:

  • the null hypothesis. Often call H_0. In your case, the null hypothesis is that the data comes from a Normal distribution.
  • the alternate hypothesis. Often call H_1 or H_A. In your case, the data comes from a non-normal distribution.

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.

  1. Plot your data as a histogram. Then superimpose a normal density with the mean and variance equal to that of your data. Does it look similar?
  2. Why does it matter if your data is Normal?
  3. Statistical questions are probably best asked at the statistics stackexchange site.
  4. See the wikipedia Normality tests page for further details.
美人如玉 2024-10-19 15:58:31

也许您忘记了这一点: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.

勿忘初心 2024-10-19 15:58:31

一般来说,较小的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:

  • Look at the other outputs from the functions you are using (i.e. the test statistic, etc.) to make sure they make sense.
  • Make sure you're not getting any warning messages during the running of the functions.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文