Skip to content

Latest commit

 

History

History
58 lines (33 loc) · 1.83 KB

quadratic_time_mmd.rst

File metadata and controls

58 lines (33 loc) · 1.83 KB

Quadratic Time MMD

The Quadratic time MMD implements a nonparametric statistical hypothesis test to reject the null hypothesis that to distributions p and q, only observed via n and m samples respectively, are the same:


H0 : p = q.

The (biased) test statistic is given by

$$\frac{1}{nm}\sum_{i=1}^n\sum_{j=1}^m k(x_i,x_i) + k(x_j, x_j) - 2k(x_i,x_j).$$

See gretton2012kernel for a detailed introduction.

Example

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

quadratic_time_mmd.sg:create_features

We create an instance of CQuadraticTimeMMD, passing it data the kernel, and the test significance level α

quadratic_time_mmd.sg:create_instance

We can select multiple ways to compute the test statistic, see CQuadraticTimeMMD for details. Unbiased statistic

quadratic_time_mmd.sg:estimate_mmd_unbiased

Biased statistic

quadratic_time_mmd.sg:estimate_mmd_biased

There are multiple ways to perform the actual hypothesis test. The permutation version simulates from H0 via repeatedly permuting the samples from p and q:

quadratic_time_mmd.sg:perform_test_permutation

The spectrum version simulates from H0 via approximating the Eigenspectrum of the underlying kernel:

quadratic_time_mmd.sg:perform_test_spectrum

The Gamma version fit a Gamma cumulative distribution function to H0 via moment matching:

quadratic_time_mmd.sg:perform_test_gamma

References

../../references.bib

Statistical_hypothesis_testing