A matlab function to compute spatial statistics.