|
From: | Thomas Shores |
Subject: | Re: kolmogorov smirnov test. Normal distribution |
Date: | Mon, 17 Mar 2008 13:11:29 -0500 |
User-agent: | Thunderbird 2.0.0.12 (X11/20080226) |
Vitaly Repin wrote:
This sample is very small, so I wouldn't place a whole lot of faith in distribution hypothesis testing. Just for the record, if you try the following distribution, you getHello! I am really confused with kolmogorov_smirnov_test now. I have prepared the X vector of normally distributed values using proprietary statistical software. And I have tried to check the distribution for normality with the help of kolmogorov_smirnov_test function. Let me show my octave session: X=[7.11, 6.73, 6.95, 7.25, 7.25, 7.03, 7.10, 7.15, 6.78, 7.09, 7.37, 7.22,6.82, 6.72, 6.95];kolmogorov_smirnov_test(X, "normal"); pval: 1.87184e-13 kolmogorov_smirnov_test(X, "uniform"); pval: 1.87184e-13So, the pval values are identical for uniform and normal distributions. What does it mean?Am I using this function in correct manner? Thank you beforehand.
kolmogorov_smirnov_test(X,'stdnormal') pval: 1.87184e-13The p-value is the likelihood of obtaining this sample, given the hypothesis of whatever distribution you are testing for being true. So all three distributions are essentially completely unlikely. I haven't examined the code, but it looks like you're getting a lower bound on some computed cdf whose real lower bound is, of course, zero.
However, you are also applying the test incorrectly, because you need to include parameters that shape the distribution in question. Try this:
>kolmogorov_smirnov_test(X,'normal',mean(X),var(X)); pval: 0.929705 > kolmogorov_smirnov_test(X,'uniform',min(X),max(X)); pval: 0.985147 > kolmogorov_smirnov_test(studentize(X),'stdnormal'); pval: 0.929682Now you have the flip side of the coin -- this sample very likely could have come from either distribution. You should try a larger sample.
Thomas Shores
[Prev in Thread] | Current Thread | [Next in Thread] |