This note discusses code-testing methods for the Kolmogorov-Smirnov test, highlighting complications and practical advice.
In this note we discuss in general how to test the implementation code of statistical tests, and then we treat in detail the case of the Kolmogorov-Smirnov test. It will be shown that some 'obvious' expected properties, like the flatness distributions of p-values from repeating drawings from the same parent distribution, are not indeed reproduced even in absence of bugs in the code, due to either asymptotic approximations in the formulas used to compute the p-value, or to the discreteness of the distance distribution in the case of direct Monte Carlo evaluation of the p-value. This makes the code-testing more complicated. Some practical advice is presented anyhow.
No takes yet. Share an insight, caveat, or question.
P. et al. (2004) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: