yat  0.10.4pre
Fisher.h
1 #ifndef _theplu_yat_statistics_fisher_
2 #define _theplu_yat_statistics_fisher_
3 
4 // $Id: Fisher.h 2555 2011-08-18 15:44:59Z 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 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 namespace theplu {
28 namespace yat {
29 namespace statistics {
62  class Fisher
63  {
64 
65  public:
69  Fisher(void);
70 
74  virtual ~Fisher(void);
75 
76 
84  double Chi2(void) const;
85 
93  void expected(double& a, double& b, double& c, double& d) const;
94 
101  unsigned int& minimum_size(void);
102 
109  const unsigned int& minimum_size(void) const;
110 
122  double p_value() const;
123 
132  double p_value_one_sided() const;
133 
147  double oddsratio(const unsigned int a, const unsigned int b,
148  const unsigned int c, const unsigned int d);
149 
155  double oddsratio(void) const;
156 
157  private:
158  bool calculate_p_exact() const;
159 
160  // two-sided
161  double p_value_approximative(void) const;
162  //two-sided
163  double p_value_exact(void) const;
164 
165  unsigned int a_;
166  unsigned int b_;
167  unsigned int c_;
168  unsigned int d_;
169  unsigned int minimum_size_;
170  double oddsratio_;
171  };
172 
173 }}} // of namespace statistics, yat, and theplu
174 
175 #endif

Generated on Mon Nov 11 2013 09:41:44 for yat by  doxygen 1.8.1