Kernel two-sample tests are based on computing the maximum mean discrepancy (MMD) between the samples,
which is the distance between their expected features in a reproducing kernel Hilbert space (RKHS).
The original proposal [1]}, however, is computationally
expensive to compute the test statistic — \(O(N^2)\)  — and to approximate its distribution under
\(H_0\)  — \(O(N^2)\)  or \(O(N^3)\)  depending on the method [2]}.
A proposed alternative, MMD-B [2]}, splits the input data into blocks, computes the original,
unbiased MMD statistic on each block — which are i.i.d —, and averages the results.
Because of the central limit theorem, this average follows asymptotically a normal distribution.
Song et al.  [4]} propose another test statistic based on MMD-B that allows
unbalanced sample sizes and is more robust to the chosen kernel bandwidth (i.e., \(\sigma \)  on a Gaussian kernel).
