00001 #ifndef _theplu_yat_statistics_fisher_
00002 #define _theplu_yat_statistics_fisher_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "Score.h"
00028
00029 #include <cmath>
00030
00031 namespace theplu {
00032 namespace yat {
00033 namespace utility {
00034 class vector;
00035 }
00036 namespace statistics {
00069 class Fisher
00070 {
00071
00072 public:
00076 Fisher(void);
00077
00081 virtual ~Fisher(void);
00082
00083
00091 double Chi2(void) const;
00092
00100 void expected(double& a, double& b, double& c, double& d) const;
00101
00108 unsigned int& minimum_size(void);
00109
00116 const unsigned int& minimum_size(void) const;
00117
00129 double p_value() const;
00130
00139 double p_value_one_sided() const;
00140
00154 double oddsratio(const unsigned int a, const unsigned int b,
00155 const unsigned int c, const unsigned int d);
00156
00157 private:
00158 bool calculate_p_exact() const;
00159
00160
00161 double p_value_approximative(void) const;
00162
00163 double p_value_exact(void) const;
00164
00165 unsigned int a_;
00166 unsigned int b_;
00167 unsigned int c_;
00168 unsigned int d_;
00169 unsigned int minimum_size_;
00170 double oddsratio_;
00171 };
00172
00173 }}}
00174
00175 #endif