| EMD | R Documentation |
x and y.Calculates the EMD for two vectors x and y.
EMD(
x,
y,
weight.m = matrix(rep(1, length(x)^2), ncol = length(x), byrow = TRUE) - diag(1,
length(x), length(x))
)
x, y |
The two vectors to compare |
weight.m |
Matrix of weights. Values should be 'numeric'. |
The EMD between x and y.
EMD(1:5/sum(1:5), 6:10/sum(6:10))
EMD(1:5, 6:10) # The vectors are normalised by the function
m <- matrix(1:25, ncol=5)
diag(m) <- 0
EMD(1:5, 6:10, weight.m=m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.