## What is the $$\textsf{L}_1$$ Metric?

It is a case of the general Minkowski metric:

$d_k(\mathbf{x},\mathbf{y}) = \left( \sum_i^m| x_i - y_i |^k \right)^\frac{1}{k}$ For $$k=1$$ - sometimes referred to as the city block metric or the Manhatten metric, particularly if $$\mathbf{x}$$ and $$\mathbf{y}$$ are 2D vectors (that is, $$m=2$$), since it approximates road distances when the roads form a regular mesh, such as those in Manhatten. Another common case of the metric is where $$k=2$$, where the metric is simply Euclidean distance. A notable property of Euclidean distance is that it is rotation invariant - it may easily be verified that that when $$m=2$$, if $$\mathbf{R}_\theta$$ is a rotation matrix through angle $$\theta$$, so we may write

$\mathbf{R}_\theta = \left( \begin{array}{rr} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{array} \right)$

then $d_2(\mathbf{x},\mathbf{y}) = d_2(\mathbf{R}_\theta \mathbf{x},\mathbf{R}_\theta \mathbf{y} )$

However this is not generally the case:

$d_k(\mathbf{x},\mathbf{y}) \ne d_k(\mathbf{R}_\theta \mathbf{x},\mathbf{R}_\theta \mathbf{y} ) \textsf{ if } k \ne 2$

In particular $$d_1(.,.)$$ is not rotation invariant.

## Kernels based on distances other than $$d_2(.,.)$$

Suppose we wished to impliment a 2D kernel function (for example to use in kernel density estimation or geographically weighted regression) based on the $$\textsf{L}_1$$ metric. A symmetrical 2D kernel generally takes the form

$\frac{1}{h^2}K\left(\frac{d(\mathbf{x},\mathbf{y})}{h}\right)$

Where typically $$K$$ takes an argument in the range $$[0,\infty)$$ and usually

• $$K'(d) < 0 \ \forall \ d$$
• $$\textsf{lim}_{d \rightarrow \infty} \ K(d) = 0$$

Common examples are

• $$K(d) = \exp(-d)$$
• $$K(d) = \exp(-\frac{d^2}{2})$$
• $$K(d) = I_{d<1}(1 - d^2)^2$$

where $$I_{s}$$ is 1 if $$s$$ is true, and 0 otherwise. Typically, distances are based on $$k=2$$ but could be defined otherwise.
Below is an interactive, rotatable and zoomable 3D image of the kernel derived when $$K(d) = \exp(-d)$$ and $$d(.,.) = d_1(.,.)$$.