L1Distance#

class tinygp.kernels.distance.L1Distance[source]#

Bases: Distance

The L1 or Manhattan distance between two coordinates

distance(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#

Compute the distance between two coordinates under this metric

squared_distance(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray#

Compute the squared distance between two coordinates

By default this returns the squared result of tinygp.kernels.stationary.Distance.distance(), but some metrics can take advantage of these separate implementations to avoid unnecessary square roots.