x1: a matrix or data frame of n1 rows (observations) and p columns (variables) (can also be a tibble) or a vector of length n1.
x2: matrix or data frame (or tibble) of n2 rows and p columns or vector of length n2.
method: string. It can be:
"gaussiand" if the densities are considered to be Gaussian.
"kern" if they are estimated using the Gaussian kernel method.
check: logical. When TRUE (the default is FALSE) the function checks if the covariance matrices (if method = "gaussiand") or smoothing bandwidth matrices (if method = "kern") are not degenerate, before computing the inner product.
Notice that if p=1, it checks if the variances or smoothing parameters are not zero.
varw1, varw2: p x p symmetric matrices: the smoothing bandwidths for the estimation of the probability densities. If they are omitted, the smoothing bandwidths are computed using the normal reference rule matrix bandwidth (see details).
Details
If method = "gaussiand", the mean vectors and the variance matrices (v1 and v2) of the two samples are computed, and they are used to compute the inner product using the l2dpar function.
If method = "kern", the densities of both samples are estimated using the Gaussian kernel method. These estimations are then used to compute the inner product. if varw1 and varw2 arguments are omitted, the smoothing bandwidths are computed using the normal reference rule matrix bandwidth:
h1v11/2
where
h1=(4/(n1(p+2)))1/(p+4)
for the first density. Idem for the second density after making the necessary changes.
Returns
The L2 inner product of the two probability densities.
Be careful! If check = FALSE and one smoothing bandwidth matrix is degenerate, the result returned can not be considered.
References
Boumaza, R., Yousfi, S., Demotes-Mainard, S. (2015). Interpreting the principal component analysis of multivariate density functions. Communications in Statistics - Theory and Methods, 44 (16), 3321-3339.
Wand, M., Jones, M. (1995). Kernel smoothing. Chapman and Hall/CRC, London.
Yousfi, S., Boumaza R., Aissani, D., Adjabi, S. (2014). Optimal bandwith matrices in functional principal component analysis of density functions. Journal of Statistical Computational and Simulation, 85 (11), 2315-2330.
Author(s)
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard
See Also
l2dpar for Gaussian densities whose parameters are given.