SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TestStatistic.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012-2013 Heiko Strathmann
8  */
9 
11 #include <shogun/base/Parameter.h>
12 
13 using namespace shogun;
14 
16 {
17  init();
18 }
19 
21 {
22 
23 }
24 
25 void CTestStatistic::init()
26 {
27  SG_ADD(&m_bootstrap_iterations, "bootstrap_iterations",
28  "Number of iterations for bootstrapping", MS_NOT_AVAILABLE);
30  "null_approximation_method",
31  "Method for approximating null distribution",
33 
36 }
37 
39  ENullApproximationMethod null_approximation_method)
40 {
41  m_null_approximation_method=null_approximation_method;
42 }
43 
45  bootstrap_iterations)
46 {
47  m_bootstrap_iterations=bootstrap_iterations;
48 }
49 
51 {
52  /* baseline method here is simply to compute statistic and p-value
53  * separately */
54  float64_t statistic=compute_statistic();
55  return compute_p_value(statistic);
56 }
57 
59 {
60  float64_t p_value=perform_test();
61  return p_value<alpha;
62 }

SHOGUN Machine Learning Toolbox - Documentation