opt-mmd icon indicating copy to clipboard operation
opt-mmd copied to clipboard

Missing coefficient for cross term in MMD

Open nik-sm opened this issue 4 years ago • 0 comments

Apologies if I'm missing something obvious, but the estimate defined in equation (3) of https://www.jmlr.org/papers/volume13/gretton12a/gretton12a.pdf looks slightly different to the MMD estimate implemented here.

The first term makes sense to me, and subtracting m accounts for the summation over i != j (since diagonal of RBF kernel will add to m). Likewise for second term. However the third term seems to be missing a factor 1 / (m*n).

https://github.com/djsutherland/opt-mmd/blob/5c02a92972df099628a4bc8351980ad9f317b6d0/two_sample/mmd.py#L44-L49

Is this implementation intended to match the estimate linked above?

Cheers

nik-sm avatar Jul 07 '21 18:07 nik-sm