Matrix of distances between discrete probability distributions given samples
Matrix of distances between discrete probability distributions given samples
Computes the matrix of the Lp distances between several multivariate or univariate discrete probability distributions, estimated from samples.
matddlp(x, p =1)
Arguments
x: object of class "folder" containing the data. Its elements are data frames (one data frame per distribution) whose columns are factors.
p: integer. Parameter of the distance.
Returns
Positive symmetric matrix whose order is equal to the number of data frames (or distributions), consisting of the pairwise Lp distances between the distributions.
Author(s)
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Sabine Demotes-Mainard
See Also
ddlp.
matddlppar for discrete probability distributions, given the probabilities on the same support.
References
Deza, M.M. and Deza E. (2013). Encyclopedia of distances. Springer.
Examples
# Example 1x1 <- data.frame(x = factor(c("A","A","B","B")))x2 <- data.frame(x = factor(c("A","A","A","B","B")))x3 <- data.frame(x = factor(c("A","A","B","B","B","B")))xf <- folder(x1, x2, x3)matddlp(xf)matddlp(xf, p =2)# Example 2x1 <- data.frame(x = factor(c("A","A","A","B","B","B")), y = factor(c("a","a","a","b","b","b")))x2 <- data.frame(x = factor(c("A","A","A","B","B")), y = factor(c("a","a","b","a","b")))x3 <- data.frame(x = factor(c("A","A","B","B","B","B")), y = factor(c("a","b","a","b","a","b")))xf <- folder(x1, x2, x3)matddlp(xf, p =1)