ddlp {dad} | R Documentation |
Distance between probability distributions of discrete variables given samples
Description
distance between two multivariate (
) or univariate (
) discrete probability distributions, estimated from samples.
Usage
ddlp(x1, x2, p = 1)
Arguments
x1 , x2 |
vectors or data frames of If they are data frames and have not the same column names, there is a warning. |
p |
integer. Parameter of the distance. |
Details
Let and
denote the estimated probability distributions of the discrete samples
and
. The
distance between the discrete probability distributions of the samples are computed using the
ddlppar
function.
Value
The distance between the two discrete probability distributions.
Author(s)
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Sabine Demotes-Mainard
References
Deza, M.M. and Deza E. (2013). Encyclopedia of distances. Springer.
See Also
ddlppar
: distance between two discrete distributions, given the probabilities on their common support.
Other distances: ddchisqsym
, ddhellinger
, ddjeffreys
, ddjensen
.
Examples
# Example 1
x1 <- c("A", "A", "B", "B")
x2 <- c("A", "A", "A", "B", "B")
ddlp(x1, x2)
ddlp(x1, x2, p = 2)
# Example 2
x1 <- 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")))
ddlp(x1, x2)