1

Is there some metric for computing similarity between two numbers which takes values in the interval $[0, 1]$?

I want something like:
$sim(1,1) = 1$
$sim(1,2) = 0.5$
...
...
$sim(50,47) = 0.78$
$sim(100,99) = 0.99$

If two numbers are small, then similarity is sensitive. But, if two numbers are big, then similarity is less sensitive.

Is there some metric like that?

Erick Wong
  • 25,198
  • 3
  • 37
  • 91
  • 1
    Have you tried dividing the small number by the large one? It seems to do exactly what you're asking for in three of your four examples. – Arthur Oct 15 '15 at 12:18
  • 1
    you are right. I use "min(num1,num2) / max(num1, num2)" and it have the property that i want. thanks. – jin-seo.lee Oct 19 '15 at 02:13
  • $d(x,y):=\frac{|x-y|}{\max{x,y}}$ seems to be literally a metric. $1-d(x,y)$ would be the measure of similarity. – Kushi Feb 05 '22 at 21:49

1 Answers1

1

Did you try s(x,y) = 2min(x,y)/(x+y)?

This measure can be based on the following measure for the (absolute) proportional difference: r(x,y) =|x/(x+y) - y/(x+y)| = |x-y|/(x+y). Viz. s(x,y) = 1 - r(x,y).

Does anyone know whether these measures have been elaborated?

r(x,y) has very nice properties, e.g.

  • 0 </= r(x,y) </= 1
  • r(x,x)=0 r(x,y) =1 iff either x or y =0
  • symmetric
  • scale invariant: r(ax,ay)=r(x,y)
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Feb 05 '22 at 21:57
  • This post is not an answer to the question; rather it is a different question. Hence your post is inappropriately placed. – amWhy Feb 05 '22 at 22:03