I have two (soon to be three) dimensional spatial data and I what to compare the goodness of fit between my model and reality. As the data is continuous and not categorial I can't really use the Chi-squared test. I have considered trying to determine the actual error on my measurements and use that as the denominator in the statistic as opposed to the usual Poisson approximation. I have also tried a 2D KS test, I have two issues here, it is rather slow and if I go to three dimensions the number of ways of defining the CDF becomes somewhat prohibitive. My other issue that I don't really know what the answer means beyond that fact that anything that doesn't come back in standard form is very good agreement.

Are there any other goodness of fit tests that are good for higher dimensions? Is Cramer von Mises any better the KS in lots of dimensions, I haven't tried but I assumed it would have the same limitations?


1 Answer 1


You can always bin/discretize your data- even in higher dimensions- and use a Chi-square test. A review of several adaptations of the KS for two dimensions, can be found here.

  • $\begingroup$ I would give +1 for the excellent ref but apparently I don't have sufficient reputation. I had considered discretizing my data as my measurements are naturally 'binned' in some sense due to a finite detector resolution. I think the interpretation of the test will be wrong. In some places the expected value of my data will quite reasonably be zero (although not the variance). This obviously results in the usual anomaly that occurs when one tries to apply the chi-squared test to non-categorical data. Maybe I should just guess the variance, gives a reasonable figure of merit I guess. $\endgroup$
    – Bowler
    Dec 2, 2011 at 17:26
  • 1
    $\begingroup$ This may prove useful: arxiv.org/abs/physics/0306171 $\endgroup$
    – jbowman
    Dec 2, 2011 at 18:09
  • $\begingroup$ @Bowler: For chi-square to be valid, a rule of thumb is that the expected counts should all exceed 5 (or 10, depends who you ask). If this does not hold, you should use "thicker" bins at the cost of power. $\endgroup$
    – JohnRos
    Dec 3, 2011 at 9:06
  • $\begingroup$ I don't have counts I have continuous data all of which are between 10 and -5 by virtue of units. I have tried the chi squared statistic with both the expected value as the variance and an approximate experimental variance as the variance and the two are not particularly similar (~1000 d.o.f.). Not that one would expect that (my expected value is typically a few, but my true error on a given point is barely 1% of the absolute value). I think I'm going to use the experimental variance, the expected value differs from the variance of my data by about 2 orders of magnitude. $\endgroup$
    – Bowler
    Dec 3, 2011 at 10:42
  • $\begingroup$ Is there any example for 2d chi square? I didn't find too many resources about that, for example, this post is only about univariate distribution, itl.nist.gov/div898/handbook/eda/section3/eda35f.htm. $\endgroup$
    – cqcn1991
    Dec 22, 2015 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.