Computes the Sorensen dissimilarity between two matrices.

sorensen_dissimilarity(A, B)

Arguments

A

A numeric matrix of size N x p.

B

A numeric matrix of size M x p.

Value

A dissimilarity matrix of size N x M.

Examples

A <- matrix(c(1, 0, 1, 0, 1, 1), nrow = 2, ncol = 3)
B <- matrix(c(0, 1, 1, 1, 0, 1), nrow = 2, ncol = 3)
sorensen_dissimilarity(A, B)
#>      [,1] [,2]
#> [1,]  0.5  0.0
#> [2,]  1.0  0.5