Calculates Hellinger distance for each pair of rows in the given matrix, or each combination of rows from the two matrices
Usage
# S3 method for Matrix
hellinger(mx1, mx2 = NULL)
Examples
set.seed(2022-06-09)
mx1 = rdirichlet(3, rep(5, 5))
mx2 = rdirichlet(3, rep(5, 5))
hellinger(mx1)
#> [,1] [,2] [,3]
#> [1,] 1.053671e-08 0.3067419 0.2668745
#> [2,] 3.067419e-01 0.0000000 0.1230902
#> [3,] 2.668745e-01 0.1230902 0.0000000
hellinger(mx1, mx2)
#> [,1] [,2] [,3]
#> [1,] 0.2361547 0.2632094 0.33018266
#> [2,] 0.1777705 0.1060308 0.12270871
#> [3,] 0.1296687 0.1732766 0.08788004