# How can I find a measure of fit for two different sets of data?

I've got two different sets of data. Each set of data is a two dimensional matrix, filled with real values. What I want to do is measure how well these sets of data correlate (so that a perfect fit would have a value of zero). For example, if the two sets of data, when plotted, are each very far apart from each other - this should be not very well correlated, and have a large value associated with it. However, if the data sets are similarly shaped and positioned very similarly, the 'correlation value' should be small.

The catch is that these data sets don't have matching x or y columns - in fact, each data set has a different number of elements. I was going to use the least squares method but then realized that this wouldn't work that easily in this case.

Are there any well known or documented techniques for doing this? If not, any ideas how I might be able to achieve this?

-
I find the question vague. Are you talking about two unordered multisets of real numbers? What do you mean by "correlate" in a case like this? –  Michael Hardy Oct 18 '11 at 1:30
@MichaelHardy I've updated the question to make it a bit more clear. –  Jordan Oct 18 '11 at 1:36
what are the dimensions of the two matrices? can you say anything more about the contents? –  Karl Oct 18 '11 at 6:14
add comment

## migrated from math.stackexchange.comOct 18 '11 at 3:25

This question came from our site for people studying math at any level and professionals in related fields.