Compute the distance between two matrices.
The distance between two matrices is defined as the sum of distances between column pairs.
This function matches the columns of two matrices, such that the matrix distance
(i.e., the sum of paired column distances) is minimized.
This is accomplished by solving an optimization over column permutation.
Given two matrices, x
and y
, find permutation p() that minimizes
sum_i similarity(x[,p(i)], y[,i]
),
where the similarity()
can be "euclidean" distance, 1 - "cosine", or "maximum" difference (manhattan distance).
The solution is computed by clue::solve_LSAP()
.