kmatdistmat: Compute distance matrix for lists of kanjimat objects
Description
Apply kmatdist to every pair of kanjimat objects to compute
the unbalanced or balanced Wasserstein distance.
Usage
kmatdistmat(
klist,
klist2 = NULL,
p = 1,
C = 0.2,
type = c("unbalanced", "balanced")
)
Value
A matrix of dimension length(klist) x length(klist2) having
as its \((i,j)\)-th entry the distance between klist[[i]] and
klist2[[j]]. If klist2 is not provided it is assumed to be equal to
klist, but the computation is more efficient as only the upper triangular part
is computed and then symmetrized with diagonal zero.
kmatdistmat(fivetrees1)
kmatdistmat(fivetrees1, fivetrees1) # same result but slowerkmatdistmat(fivetrees1, fivetrees2) # note the smaller values on the diagonal