gaussbarypd: Barycenter of Gaussian Distributions in \mathbf{R}^p In T4transport: Tools for Computational Optimal Transport

 gaussbarypd R Documentation

Barycenter of Gaussian Distributions in \mathbf{R}^p

Description

Given a collection of n-dimensional Gaussian distributions \mathcal{N}(\mu_i, \Sigma_i^2) for i=1,\ldots,n, compute the Wasserstein barycenter of order 2. For the barycenter computation of variance components, we use a fixed-point algorithm by \insertCiteAlvarezEsteban;textualT4transport.

Usage

gaussbarypd(means, vars, weights = NULL, ...)


Arguments

 means an (n\times p) matrix whose rows are mean vectors. vars a (p\times p\times n) array where each slice is covariance matrix. weights a weight of each image; if NULL (default), uniform weight is set. Otherwise, it should be a length-n vector of nonnegative weights. ... extra parameters including abstolstopping criterion for iterations (default: 1e-8). maxitermaximum number of iterations (default: 496).

Value

a named list containing

mean

a length-p vector for mean of the estimated barycenter distribution.

var

a (p\times p) matrix for variance of the estimated barycenter distribution.

References

\insertAllCited

gaussbary1d() for univariate case.

Examples


#----------------------------------------------------------------------
#                         Two Gaussians in R^2
#----------------------------------------------------------------------
# GENERATE PARAMETERS
# means
par_mean = rbind(c(-4,0), c(4,0))

# covariances
par_vars = array(0,c(2,2,2))
par_vars[,,1] = cbind(c(4,-2),c(-2,4))
par_vars[,,2] = cbind(c(4,+2),c(+2,4))

# COMPUTE THE BARYCENTER OF EQUAL WEIGHTS
gmean = gaussbarypd(par_mean, par_vars)

# GET COORDINATES FOR DRAWING
pt_type1 = gaussvis2d(par_mean[1,], par_vars[,,1])
pt_type2 = gaussvis2d(par_mean[2,], par_vars[,,2])
pt_gmean = gaussvis2d(gmean$mean, gmean$var)

# VISUALIZE