Maximum Mean Discrepancy with Gaussian (RBF) kernel.
- Computes the MMD statistic between two sample sets using:
MMD² = E[k(X,X’)] + E[k(Y,Y’)] - 2*E[k(X,Y)]
where k is the Gaussian kernel k(x,y) = exp(-||x-y||² / (2*σ²)).
- Parameters:
samples_a (Array) – First set of samples (n, dim)
samples_b (Array) – Second set of samples (m, dim)
bandwidth (float | None) – Kernel bandwidth σ. If None, uses median heuristic.
- Return type:
float
- Returns:
MMD statistic (lower = more similar, 0 = identical)