SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TestStatistic.h
Go to the documentation of this file.
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-2013 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 EStatisticType
00020 {
00021     S_LINEAR_TIME_MMD, S_QUADRATIC_TIME_MMD, S_HSIC
00022 };
00023 
00025 enum ENullApproximationMethod
00026 {
00027     BOOTSTRAP, MMD2_SPECTRUM, MMD2_GAMMA, MMD1_GAUSSIAN, HSIC_GAMMA
00028 };
00029 
00047 class CTestStatistic : public CSGObject
00048 {
00049     public:
00050         CTestStatistic();
00051 
00052         virtual ~CTestStatistic();
00053 
00055         virtual float64_t compute_statistic()=0;
00056 
00066         virtual float64_t compute_p_value(float64_t statistic)=0;
00067 
00076         virtual float64_t compute_threshold(float64_t alpha)=0;
00077 
00093         virtual float64_t perform_test();
00094 
00107         bool perform_test(float64_t alpha);
00108 
00114         virtual SGVector<float64_t> bootstrap_null()=0;
00115 
00120         virtual void set_bootstrap_iterations(index_t bootstrap_iterations);
00121 
00125         virtual void set_null_approximation_method(
00126                 ENullApproximationMethod null_approximation_method);
00127 
00129         virtual EStatisticType get_statistic_type() const=0;
00130 
00131         virtual const char* get_name() const=0;
00132 
00133     private:
00134         void init();
00135 
00136     protected:
00138         index_t m_bootstrap_iterations;
00139 
00141         ENullApproximationMethod m_null_approximation_method;
00142 };
00143 
00144 }
00145 
00146 #endif /* __TESTSTATISTIC_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation