kmatdistmat {kanjistat} | R Documentation |
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")
)
Arguments
klist |
a list of |
klist2 |
an optional second list of |
p , C , type |
the same as for the function |
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.
See Also
Examples
kmatdistmat(fivetrees1)
kmatdistmat(fivetrees1, fivetrees1) # same result but slower
kmatdistmat(fivetrees1, fivetrees2) # note the smaller values on the diagonal
[Package kanjistat version 0.14.1 Index]