Suppose there are two arrays (They have the same length), I want to give a quantitative description about the similarity between them. Is there any way to achieve that? I define a formula like this, but how to calculate it? $$ \min_{1\le i\le n,1\le j\le n}(A_i-B_j)^2 $$

  • $\begingroup$ I think this question needs more background on "similarity between predicted data and observed data," mentioned in your comment below. Otherwise it makes not much sense. $\endgroup$ – Dietrich Burde Mar 24 at 12:55
  • $\begingroup$ Yes. Maybe you are right. It just occurred to me when I was reviewing what I have learned on my course "Introduction to Bayesian Statistics". Therefore, there is not much background. $\endgroup$ – DingDong Mar 24 at 13:01

Some standard distances are
$$\sum_{i=1}^n(A_i-B_i)^2\\ \sum_{i=1}^n|A_i-B_i|\\ \max_i|A_i-B_i|$$
But they are only useful if the order matters in each array.

| cite | improve this answer | |
  • $\begingroup$ Yes. Actually my goal is to measure the similarity between two groups and the similarity should not be affected by the order. For example, I build a model with some observed data, and then I can use this model to predict new data. Now, I want to decide if this model is valid depending on the similarity between predicted data and observed data. Is there any method? $\endgroup$ – DingDong Mar 24 at 12:54
  • $\begingroup$ That is a big part of statistics. Perhaps look up 'Student's t test' $\endgroup$ – Empy2 Mar 24 at 12:59

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