From cgenolin at u-paris10.fr  Sat Feb  6 16:39:31 2010
From: cgenolin at u-paris10.fr (Christophe Genolini)
Date: Sat, 06 Feb 2010 16:39:31 +0100
Subject: [Rd] Canberra distance
Message-ID: <4B6D8D33.2070108@u-paris10.fr>

Hi the list,

According to what I know, the Canberra distance between X et Y is : sum[ 
(|x_i - y_i|) / (|x_i|+|y_i|) ] (with | | denoting the function 
'absolute value')
In the source code of the canberra distance in the file distance.c, we 
find :

    sum = fabs(x[i1] + x[i2]);
    diff = fabs(x[i1] - x[i2]);
    dev = diff/sum;

which correspond to the formula : sum[ (|x_i - y_i|) / (|x_i+y_i|) ]
(note that this does not define a distance... This is correct when x_i 
and y_i are positive, but not when a value is negative.)

Is it on purpose or is it a bug?

Christophe



[Rd] Canberra distance
Christophe Genolini