distl2dnorm | R Documentation |
L^2
distance between L^2
-normed probability densities
L^2
distance between two multivariate (p > 1
) or univariate (dimension: p = 1
) L^2
-normed probability densities, estimated from samples, where a L^2
-normed probability density is the original probability density function divided by its L^2
-norm.
distl2dnorm(x1, x2, method = "gaussiand", check = FALSE, varw1 = NULL, varw2 = NULL)
x1, x2 |
the samples from the probability densities (see |
method |
string. It can be:
|
check |
logical. When Notice that if |
varw1, varw2 |
the bandwidths when the densities are estimated by the kernel method (see |
Given densities f_1
and f_2
, the function distl2dnormpar
computes the distance between the L^2
-normed densities f_1 / ||f_1||
and f_2 / ||f_2||
:
2 - 2 <f_1, f_2> / (||f_1|| ||f_2||)
For some information about the method used to compute the L^2
inner product or about the arguments, see l2d
.
The L^2
distance between the two L^2
-normed densities.
Be careful! If check = FALSE
and one smoothing bandwidth matrix is degenerate, the result returned can not be considered.
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard
distl2d
for the distance between two probability densities.
matdistl2dnorm
in order to compute pairwise distances between several L^2
-normed densities.
require(MASS)
m1 <- c(0,0)
v1 <- matrix(c(1,0,0,1),ncol = 2)
m2 <- c(0,1)
v2 <- matrix(c(4,1,1,9),ncol = 2)
x1 <- mvrnorm(n = 3,mu = m1,Sigma = v1)
x2 <- mvrnorm(n = 5, mu = m2, Sigma = v2)
distl2dnorm(x1, x2, method = "gaussiand")
distl2dnorm(x1, x2, method = "kern")
distl2dnorm(x1, x2, method = "kern", varw1 = v1, varw2 = v2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.