# Canberra distance

The Canberra distance is a numerical measure of the distance between pairs of points in a vector space, introduced in 1966[1] and refined in 1967[2] by Godfrey N. Lance and William T. Williams. It is a weighted version of L₁ (Manhattan) distance.[3] The Canberra distance has been used as a metric for comparing ranked lists[3] and for intrusion detection in computer security.[4] It has also been used to analyze the gut microbiome in different disease states.[5]

## Definition

The Canberra distance d between vectors p and q in an n-dimensional real vector space is given as follows:

${\displaystyle d(\mathbf {p} ,\mathbf {q} )=\sum _{i=1}^{n}{\frac {|p_{i}-q_{i}|}{|p_{i}|+|q_{i}|}}}$

where

${\displaystyle \mathbf {p} =(p_{1},p_{2},\dots ,p_{n}){\text{ and }}\mathbf {q} =(q_{1},q_{2},\dots ,q_{n})}$

are vectors.

The Canberra metric, Adkins form, divides the distance d by (n-Z) where Z is the number of attributes that are 0 for p and q.