Is there a multivariate alternative to two-sample Kolmogorov–Smirnov test? What I mean is a test that can be used to check whenever two underlying multidimensional distributions differ.
-
1$\begingroup$ I am facing the same question. Have you learned anything useful and made any conclusions? I do see the answer, but beyond it I wonder about your experience with the suggestions and what worked best. $\endgroup$– Richard HardyCommented Mar 31, 2021 at 14:06
-
$\begingroup$ @RichardHardy nope. $\endgroup$– TimCommented Mar 31, 2021 at 14:22
3 Answers
A 2004 article On a new multivariate two-sample test by Baringhaus and Franz maybe helpful, they provided a brief literature review on the two-sample multivariate GoF tests and then a R package cramer
. As the package name suggested their method is related to Cramer's test, a predecessor of Cramer-von Mises.
For one-sample problem Justel et al. developed a generalization of Kolmogorov-Smirnov test. In general it seems the difficulty in multivariate case rooted from extending the definition of EDF (empirical distribution function), so methods based on other measures are worth exploring, e.g. multivariate tests based on ECF (empirical characteristic function) by Fan.
-
3$\begingroup$ Please spell out abbrevs EDF, ECF $\endgroup$ Commented Apr 13, 2017 at 22:24
-
2$\begingroup$ @kjetilbhalvorsen: fixed, though it's quite clear what they are once click the links provided. $\endgroup$– FrancisCommented Apr 13, 2017 at 23:00
-
$\begingroup$ Is there a python implementation of this? $\endgroup$ Commented May 4, 2022 at 21:15
-
1
Yes, the two sample KS test was extended to the multivariate case in 2021. https://www.sciencedirect.com/science/article/pii/S016771522100050X
-
2$\begingroup$ While the link maybe helpful in answering OP's query, in the long run, link only answers prove useless once the link dies. So, it would be appreciable if you are able to jot down the crux of what has been presented there. $\endgroup$ Commented Jan 2, 2023 at 17:06
For a practical application of the multivariate KS distance in high dimensions, see my article New Python Library to Evaluate AI-generated Data and Compare Models. I actually created a Python library to do the computations.