yat  0.12.3pre
Fisher.h
1 #ifndef _theplu_yat_statistics_fisher_
2 #define _theplu_yat_statistics_fisher_
3 
4 // $Id: Fisher.h 3004 2013-03-24 00:51:14Z peter $
5 
6 /*
7  Copyright (C) 2004, 2005 Peter Johansson
8  Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2009, 2011, 2013 Peter Johansson
10 
11  This file is part of the yat library, http://dev.thep.lu.se/yat
12 
13  The yat library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License as
15  published by the Free Software Foundation; either version 3 of the
16  License, or (at your option) any later version.
17 
18  The yat library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with yat. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #include <yat/utility/deprecate.h>
28 
29 namespace theplu {
30 namespace yat {
31 namespace statistics {
32 
65  class Fisher
66  {
67 
68  public:
72  Fisher(void);
73 
77  virtual ~Fisher(void);
78 
79 
89  double Chi2(void) const;
90 
98  void expected(double& a, double& b, double& c, double& d) const;
99 
106  unsigned int& minimum_size(void);
107 
114  const unsigned int& minimum_size(void) const;
115 
124  double p_left(void) const;
125 
134  double p_right(void) const;
135 
147  double p_value(void) const;
148 
160  double p_value_one_sided() const YAT_DEPRECATE;
161 
175  double oddsratio(const unsigned int a, const unsigned int b,
176  const unsigned int c, const unsigned int d);
177 
183  double oddsratio(void) const;
184 
185  private:
186  bool calculate_p_exact(void) const;
187 
188  // two-sided
189  double p_value_approximative(void) const;
190  double p_left_exact(void) const;
191  double p_right_exact(void) const;
192  //two-sided
193  double p_value_exact(void) const;
194 
195  unsigned int a_;
196  unsigned int b_;
197  unsigned int c_;
198  unsigned int d_;
199  unsigned int minimum_size_;
200  double oddsratio_;
201  };
202 
203 }}} // of namespace statistics, yat, and theplu
204 
205 #endif
double p_value(void) const
double p_left(void) const
Fisher&#39;s exact test.
Definition: Fisher.h:65
unsigned int & minimum_size(void)
double oddsratio(void) const
double p_right(void) const
void expected(double &a, double &b, double &c, double &d) const

Generated on Mon Jun 1 2015 12:29:52 for yat by  doxygen 1.8.5