distl2dnormpar: \(L^2\) distance between \(L^2\)-normed Gaussian densities given their parameters
Description
\(L^2\) distance between two multivariate (\(p > 1\)) or univariate (dimension: \(p = 1\)) \(L^2\)-normed Gaussian densities, given their parameters (mean vectors and covariance matrices if the densities are multivariate, or means and variances if univariate) where a \(L^2\)-normed probability density is the original probability density function divided by its \(L^2\)-norm.
The \(L^2\) distance between the two \(L^2\)-normed Gaussian densities.
Be careful! If check = FALSE and one variance matrix is degenerated (or one variance is zero if the densities are univariate), the result returned must not be considered.
Arguments
mean1, mean2
means of the probability densities.
var1, var2
variances (\(p\) = 1) or covariance matrices (\(p\) > 1) of the probability densities.
check
logical. When TRUE (the default is FALSE) the function checks if the covariance matrices are not degenerate, before computing the inner product.
If the variables are univariate, it checks if the variances are not zero.
Author
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard
Details
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 l2dpar; the norm \(||f||\) of the multivariate Gaussian density \(f\) is equal to \((4\pi)^{-p/4} det(var)^{-1/4}\).
See Also
distl2dpar for the distance between two probability densities.
matdistl2d in order to compute pairwise distances between several densities.