It computes the distance matrix of a set of \(n\)
two-dimensional points given by a \(n\times 2\) matrix using
the distance-\(p\) with \(p=2\) by default.
Usage
compute_distance_matrix(z, p = 2)
Value
The distance-\(p\) of the points.
Arguments
z
A \(n\times 2\) matrix with the two-dimensional points
p
The \(p\) parameter of the distance-\(p\). It
defaults to 2.
Author
Cesar Asensio
Details
Given a set of \(n\) points \(\{z_j\}_{j=1,...,n}\), the
distance matrix is a \(n\times n\) symmetric matrix with
matrix elements $$d_{ij} = d(z_i,z_j)$$ computed using the
distance-\(p\) given by $$d_p(x,y) = \left(\sum_i
(x_i-y_i)^p\right)^{\frac{1}{p}}$$.
See Also
compute_p_distance computes the distance-\(p\),
compute_tour_distance computes tour distances. A distance
matrix can also be computed using dist.