Skip to content

Commit

Permalink
first meta example for mmd
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Jul 1, 2016
1 parent a611c66 commit ada18dc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/meta/src/statistical_testing/quadratic_time_mmd.sg
@@ -0,0 +1,18 @@
CSVFile f_features_p("../../data/two_sample_test_gaussian.dat")
CSVFile f_features_q("../../data/two_sample_test_laplace.dat")

RealFeatures features_p(f_features_p)
RealFeatures features_q(f_features_q)

GaussianKernel kernel()

QuadraticTimeMMD mmd()
mmd.set_kernel(kernel)
mmd.set_p(features_p)
mmd.set_q(features_q)

Real statistic = mmd.compute_statistic()
Real alpha = 0.05
Real threshold = mmd.compute_threshold(alpha)
Real p_value = mmd.compute_p_value(alpha)
Real h0_rejected = mmd.perform_test(alpha)

0 comments on commit ada18dc

Please sign in to comment.