The Kolmogorov-Smirnov Test
daithiocrualaoich.github.io
daithiocrualaoich.github.io
1. Failing to reject the null hypothesis is not the same as accepting the null hypothesis. That is, concluding "these data are from some distribution X" is spurious.
2. There's a 'sweet-spot' for the amount of data. If you have too few samples, it's very easy to fail to reject; and if you have too many, it's very easy to reject (the chart at the bottom of the "Two Sample Test" section illustrates this).
3. The question "are these data from some distribution X?" is usually too strong. It's usually more informative to ask "can these data be modelled with some distribution X?"
What do you mean by this? You can choose any significance level you like.
I did it all in ruby at the time, but it looks like rust may have some stats libraries now? Should give it a whirl again this time using rust, or maybe do tpatcek's new Stockfighter game instead.
For choosing distributions, we ended up plotting observations versus various simulated realities and going with the "eye test". Now, of course, there will be those out that that say this is not rigorous enough, but for most phenomena in the social sciences its very hard to find a distribution that fits reality per the K-S test. So you're left with either bootstrapping (which has its own flaws) a distribution or choosing one that's good enough (e.g. passing the eye test).
I think it comes from 'shots fired in practice' vs. 'shots fired in anger' (i.e. in combat, for the purpose of killing).
if you are specifically testing against the normal dist the jarque bera test might be better, although also rather sensitive (prone to false negatives).
for two samples if you have enough data to bin, the chisq test is also available to you.
But that test and many more are part of non-parametric, that is, distribution-free hypothesis testing. That statistics has long been popular in the social sciences. A major theme in such statistics is permutations. Another major theme, and more recent, is resampling.
I first learned about such tests from a book that was sitting around the office, Sidney Siegel, Nonparametric Statistics for the Behavioral Sciences.
These tests are all one dimensional. Once I published a paper on a distribution-free test that is multi-dimensional -- my paper may remain the only such.
These days, see also the work of B. Efron and P. Diaconis.
More can be done.
HN discussion: https://news.ycombinator.com/item?id=10244950