w2dist: w2dist

Description Usage Arguments Value Examples

View source: R/w2dist.R

Description

The 2-Wasserstein distance between two multivariate normal distributions

Usage

1
w2dist(P, Q)

Arguments

P

A multivariate normal distribution given as a list with arguments mean and cov.

Q

A multivariate normal distribution given as a list with arguments mean and cov.

Value

A double giving the 2-Wasserstein distance between the two distributions.

Examples

1
2
3
4
P <- list(mean = c(1, 1), cov = diag(1, 2))
Q <- list(mean = c(0, 0), cov = 1.1*diag(1, 2))
Q <- list(mean = c(0, 0), cov = 1.1*diag(1, 2))
w2dist(P, Q)

HristoInouzhe/optimalFlow documentation built on April 24, 2020, 4:31 a.m.