R-CMD-check codecov

EasyMMD

Gretton et al. (2007) introduced Maximum Mean Discrepancy (MMD). EasyMMD in an R package which provides a simple (hopefully!) and computationally efficient way to compute the MMD between two datasets.

Installation

You can install EasyMMD from github with:

devtools::install_github("AnthonyEbert/EasyMMD")

Example

This is a basic example which shows you how to solve a common problem:

library(EasyMMD)

n <- 1e3
x <- rnorm(n)
y <- rnorm(n, 5)


MMD(y,x)

# For faster computation, precompute part of the MMD for the observed data y

y_kmmd <- kmmd(y)

MMD(y,x, y_kmmd)

microbenchmark::microbenchmark(MMD(y,x), MMD(y,x, y_kmmd), times = 10)

References

Gretton, A., Borgwardt, K. M., Rasch, M., Schölkopf, B., & Smola, A. J. (2007). A kernel method for the two-sample-problem. In Advances in neural information processing systems (pp. 513-520).



AnthonyEbert/EasyMMD documentation built on March 29, 2022, 8:55 p.m.