00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2012 Heiko Strathmann 00008 */ 00009 00010 #ifndef __TESTSTATISTIC_H_ 00011 #define __TESTSTATISTIC_H_ 00012 00013 #include <shogun/base/SGObject.h> 00014 00015 namespace shogun 00016 { 00017 00019 enum ENullApproximationMethod 00020 { 00021 BOOTSTRAP, MMD2_SPECTRUM, MMD2_GAMMA, MMD1_GAUSSIAN, HSIC_GAMMA 00022 }; 00023 00041 class CTestStatistic : public CSGObject 00042 { 00043 public: 00044 CTestStatistic(); 00045 00046 virtual ~CTestStatistic(); 00047 00049 virtual float64_t compute_statistic()=0; 00050 00060 virtual float64_t compute_p_value(float64_t statistic)=0; 00061 00070 virtual float64_t compute_threshold(float64_t alpha)=0; 00071 00087 virtual float64_t perform_test(); 00088 00101 bool perform_test(float64_t alpha); 00102 00108 virtual SGVector<float64_t> bootstrap_null()=0; 00109 00114 virtual void set_bootstrap_iterations(index_t bootstrap_iterations); 00115 00119 virtual void set_null_approximation_method( 00120 ENullApproximationMethod null_approximation_method); 00121 00122 virtual const char* get_name() const=0; 00123 00124 private: 00125 void init(); 00126 00127 protected: 00129 index_t m_bootstrap_iterations; 00130 00132 ENullApproximationMethod m_null_approximation_method; 00133 }; 00134 00135 } 00136 00137 #endif /* __TESTSTATISTIC_H_ */