Learn R Programming

dad (version 4.1.6)

mathellingerpar: Matrix of Hellinger distances between Gaussian densities given their parameters

Description

Computes the matrix of the Hellinger distances between several multivariate (\(p > 1\)) or univariate (\(p = 1\)) Gaussian densities, given their means and variances, using hellingerpar.

Usage

mathellingerpar(meanL, varL)

Value

Positive symmetric matrix whose order is equal to the number of densities, consisting of the pairwise distances between the Gaussian densities.

Arguments

meanL

list of the means (\(p = 1\)) or vector means (\(p > 1\)) of the Gaussian densities.

varL

list of the variances (\(p = 1\)) or covariance matrices (\(p > 1\)) of the Gaussian densities.

Author

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

See Also

hellingerpar.

mathellinger for the distance matrix between probability densities which are estimated from the data.

Examples

Run this code
    data(roses)
    
    # Multivariate:
    X <- roses[,c("Sha","Den","Sym","rose")]
    summary(X)
    mean.X <- as.list(by(X[, 1:3], X$rose, colMeans))
    var.X <- as.list(by(X[, 1:3], X$rose, var))
    mathellingerpar(mean.X, var.X)

    # Univariate :
    X1 <- roses[,c("Sha","rose")]
    summary(X1)
    mean.X1 <- by(X1$Sha, X1$rose, mean)
    var.X1 <- by(X1$Sha, X1$rose, var)
    mathellingerpar(mean.X1, var.X1)

Run the code above in your browser using DataLab