Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.1 KB

linear_time_mmd.rst

File metadata and controls

39 lines (24 loc) · 1.1 KB

Linear Time MMD

The linear time MMD implements a nonparametric statistical hypothesis test to reject the null hypothesis that to distributions p and q, each only observed via n samples, are the same, i.e. H0 : p = q.

The (unbiased) statistic is given by

$$\frac{2}{n}\sum_{i=1}^n k(x_{2i},x_{2i}) + k(x_{2i+1}, x_{2i+1}) - 2k(x_{2i},x_{2i+1}).$$

See gretton2012kernel for a detailed introduction.

Example

Imagine we have samples from p and p. We create CDenseFeatures (here 64 bit floats aka RealFeatures)as

linear_time_mmd.sg:create_features

We create an instance of CLinearTimeMMD, passing it data and the kernel to use, a CGaussianKernel here.

linear_time_mmd.sg:create_instance

Computing the statistic is done as

linear_time_mmd.sg:estimate_mmd

We can perform the hypothesis test as

linear_time_mmd.sg:perform_test

References

../../references.bib