t****g 发帖数: 715 | 1 Hi,
Does anyone here know how to conduct a Kolmogorov-Smirnov test for a
discrete distribution in any software package?
Here is my problem: I have a vector of data, and I want to test whether it
follows a binomial distribution. In addition, I need to do it using the K-S
test.
As far as I know, K-S test works well for continuous distributions, but does
not do a good job for discrete ones. I tried R (ks.test) and Matlab (kstest
), and got spurious results. It seems in R, "ks.boot" works for the di | l*********1 发帖数: 66 | 2 Hi,
I happend to use KS test in R these days.
I didn't know that it would be different for discrete data.
Won't the K-S test also apply for the discrete data?
For binomial(n,p), with n and p fixed, it's F(x) is determined, I think you
can just use it as one of the two samples, so you can compare it with the
other one.
If n is large, I think it is very close to a contiouns case, so K-S
method should have no problem.
If n is small, I think you can try the Chi-square test. that each catergory(
0,1, | B****n 发帖数: 11290 | 3 如果沒記錯 對discrete data 因為會有ties 所以會有些不太一樣
you
catergory(
【在 l*********1 的大作中提到】 : Hi, : I happend to use KS test in R these days. : I didn't know that it would be different for discrete data. : Won't the K-S test also apply for the discrete data? : For binomial(n,p), with n and p fixed, it's F(x) is determined, I think you : can just use it as one of the two samples, so you can compare it with the : other one. : If n is large, I think it is very close to a contiouns case, so K-S : method should have no problem. : If n is small, I think you can try the Chi-square test. that each catergory(
| t****g 发帖数: 715 | 4 Yes, Chi square test is a good alternative here, while I have to use KS for
my application (I was asked to do so). In theory, the original KS test only
works for continuous distributions, though an extention to discrete is also
available. However, software packages usually only offer KS for continuous.
If you apply it(e.g. R, ks.test) to discrete, the p values are misleading.
I am looking for codes(or functions in popular packages) that implement KS
to discrete, and report correct p values.
yo
【在 l*********1 的大作中提到】 : Hi, : I happend to use KS test in R these days. : I didn't know that it would be different for discrete data. : Won't the K-S test also apply for the discrete data? : For binomial(n,p), with n and p fixed, it's F(x) is determined, I think you : can just use it as one of the two samples, so you can compare it with the : other one. : If n is large, I think it is very close to a contiouns case, so K-S : method should have no problem. : If n is small, I think you can try the Chi-square test. that each catergory(
|
|