SHOGUN
v3.2.0
|
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 __HSIC_H_ 00011 #define __HSIC_H_ 00012 00013 #include <shogun/statistics/KernelIndependenceTestStatistic.h> 00014 00015 namespace shogun 00016 { 00017 00018 template<class T> class SGMatrix; 00019 00020 00067 class CHSIC : public CKernelIndependenceTestStatistic 00068 { 00069 public: 00071 CHSIC(); 00072 00084 CHSIC(CKernel* kernel_p, CKernel* kernel_q, CFeatures* p_and_q, 00085 index_t m); 00086 00099 CHSIC(CKernel* kernel_p, CKernel* kernel_q, CFeatures* p, CFeatures* q); 00100 00101 virtual ~CHSIC(); 00102 00112 virtual float64_t compute_statistic(); 00113 00122 virtual float64_t compute_p_value(float64_t statistic); 00123 00131 virtual float64_t compute_threshold(float64_t alpha); 00132 00133 virtual const char* get_name() const 00134 { 00135 return "HSIC"; 00136 } 00137 00139 virtual EStatisticType get_statistic_type() const 00140 { 00141 return S_HSIC; 00142 } 00143 00163 SGVector<float64_t> fit_null_gamma(); 00164 00172 virtual SGVector<float64_t> bootstrap_null(); 00173 00174 protected: 00176 SGMatrix<float64_t> get_kernel_matrix_K(); 00177 00179 SGMatrix<float64_t> get_kernel_matrix_L(); 00180 00181 private: 00182 void init(); 00183 00184 }; 00185 00186 } 00187 00188 #endif /* __HSIC_H_ */