Two-dimensional Kolmogorov–Smirnov I would like to run some two dimensional Kolmogorov–Smironov tests to determine whether a two-dimensional distribution fits with a reference.
Is there any package or application that I could use in a relatively straightforward fashion? Or is there a different algorithm that is preferrable? I have just a basic statistical knowledge.
 A: Python implementation
I have written a python implementation using numpy. You can find the code here, you may find more infomation in the docstring in the code.
And here's another one (not by me). This Notebook provide a Python implementation for 2D K-S test with 2 samples. The .py file can be downloaded here. The code seems to be a straight translation of C code, the efficiency might be a problem if sample size is large.
However you'd better check the codes (no matter which one) with the original papers/books before you use. The python implementations of 2d KS test are far less checked than the ones in R.
More infomation
The algorithm is first developed in two papers (as I see)

*

*Peacock, J.A. 1983, Two-Dimensional Goodness-of-Fit Testing in Astronomy

*Fasano, G. and Franceschini, A. 1987, A Multidimensional Version of the Kolmogorov-Smirnov Test.

A nice introduction and the C implementation can be found in

*

*Press, W.H. et al. 1992, Numerical Recipes in C, Section 14.7, p645.
You can find C++/Fortran implementation in other versions of the book.
Here's a post titled Beware the Kolmogorov-Smirnov test is also related to the subject, you may want to have a look. It encourages using resample method to evaluate the p-value with given KS distance.
A: A two-dimensional extension of the Kolmogorov-Smirnov test has been described by Justel, Pena and Zamar in a "A multivariate Komogorov-Smirnov test of goodness of fit".  @Procrastinator's comments suggests there may be other such proposals.  
However, I haven't seen a package with a straightforward implementation.
Depending on what you want to do, kde.test() in Tarn Duong's ks package for R might be more useful.
A: you may find this Matlab code to be useful. 
http://www.mathworks.com/matlabcentral/fileexchange/38617-two-dimensional-2d-paired-kolmogorov-smirnov-test
