Learn R Programming

dad (version 4.1.6)

matwasserstein: Matrix of 2-Wassterstein distance between Gaussian densities

Description

Computes the matrix of the 2-Wassterstein distances between several multivariate (\(p > 1\)) or univariate (\(p = 1\)) Gaussian densities, given samples.

Usage

matwasserstein(x)

Value

Positive symmetric matrix whose order is equal to the number of densities, consisting of the pairwise 2-Wassterstein distance between the Gaussian densities.

Arguments

x

object of class "folder" containing the data. Its elements have only numeric variables (observations of the probability densities). If there are non numeric variables, there is an error.

Author

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

See Also

matwassersteinpar if the parameters of the Gaussian densities are known.

Examples

Run this code
    data(roses)
    
    # Multivariate:
    X <- as.folder(roses[,c("Sha","Den","Sym","rose")], groups = "rose")
    summary(X)
    matwasserstein(X)
    
    # Univariate :
    X1 <- as.folder(roses[,c("Sha","rose")], groups = "rose")
    summary(X1)
    matwasserstein(X1)

Run the code above in your browser using DataLab