dist4den | R Documentation |
L^2
Wasserstein distance between two distributions.L^2
Wasserstein distance between two distributions.
dist4den(d1 = NULL, d2 = NULL, fctn_type = NULL, optns = list())
d1 , d2 |
Lists holding the density functions or quantile functions of the two distributions.
Each list consists of two numeric vectors |
fctn_type |
Character vector of length 1 holding the function type in |
optns |
A list of control parameters specified by |
Available control options are:
A scalar giving the length of the support grid of quantile functions based on which the L^2
Wasserstein distance (i.e., the L^2
distance between the quantile functions) is computed. Default is 201.
A scalar holding the L^2
Wasserstein distance between d1
and d2
.
d1 <- list(x = seq(-6,6,0.01))
d1$y <- dnorm(d1$x)
d2 <- list(x = d1$x + 1)
d2$y <- dnorm(d2$x, mean = 1)
dist <- dist4den(d1 = d1,d2 = d2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.