# How to compute the similarity between two arrays? [closed]

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$$

• 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. – Dietrich Burde Mar 24 at 12:55
• 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. – DingDong Mar 24 at 13:01

$$\sum_{i=1}^n(A_i-B_i)^2\\ \sum_{i=1}^n|A_i-B_i|\\ \max_i|A_i-B_i|$$