A multidimensional version of the Kolmogorov–Smirnov test

Abstract
We discuss a generalization of the classical Kolmogorov–Smirnov test, which is suitable to analyse random samples defined in two or three dimensions. This test provides some improvements with respect to an earlier version proposed by Peacock. In particular: (i) it is faster, by a factor equal to the sample size, n, and then usable to analyse quite sizeable samples; (ii) it fully takes into account the dependence of the test statistics on the degree of correlation of data points and on the sample size; (iii) it allows for a generalization to the three-dimensional case which is still viable as regards computing time. Supported by a large number of Monte Carlo simulations, we are ensured that this test is sufficiently distribution-free for any practical purposes. We also give a simple analytic expression to make easier the calculation of the critical values of the test probability distribution. To illustrate how the test works, we use it to analyse models of the cosmological evolution of X-ray selected active galactic nuclei and we show that it is a much more sensitive goodness-of-fit test than the χ2.