yat  0.8.3pre
Fisher.h
00001 #ifndef _theplu_yat_statistics_fisher_
00002 #define _theplu_yat_statistics_fisher_ 
00003 
00004 // $Id: Fisher.h 2555 2011-08-18 15:44:59Z peter $
00005 
00006 /*
00007   Copyright (C) 2004, 2005 Peter Johansson
00008   Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
00009   Copyright (C) 2009, 2011 Peter Johansson
00010 
00011   This file is part of the yat library, http://dev.thep.lu.se/yat
00012 
00013   The yat library is free software; you can redistribute it and/or
00014   modify it under the terms of the GNU General Public License as
00015   published by the Free Software Foundation; either version 3 of the
00016   License, or (at your option) any later version.
00017 
00018   The yat library is distributed in the hope that it will be useful,
00019   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00021   General Public License for more details.
00022 
00023   You should have received a copy of the GNU General Public License
00024   along with yat. If not, see <http://www.gnu.org/licenses/>.
00025 */
00026 
00027 namespace theplu {
00028 namespace yat {
00029 namespace statistics {  
00062   class Fisher
00063   {
00064   
00065   public:
00069     Fisher(void);
00070 
00074     virtual ~Fisher(void);
00075          
00076     
00084     double Chi2(void) const;
00085 
00093     void expected(double& a, double& b, double& c, double& d) const;
00094 
00101     unsigned int& minimum_size(void);
00102 
00109     const unsigned int& minimum_size(void) const;
00110 
00122     double p_value() const;
00123     
00132     double p_value_one_sided() const;
00133     
00147     double oddsratio(const unsigned int a, const unsigned int b, 
00148                      const unsigned int c, const unsigned int d);
00149 
00155     double oddsratio(void) const;
00156 
00157   private:
00158     bool calculate_p_exact() const;
00159 
00160     // two-sided
00161     double p_value_approximative(void) const;
00162     //two-sided
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 }}} // of namespace statistics, yat, and theplu
00174 
00175 #endif

Generated on Thu Dec 20 2012 03:12:58 for yat by  doxygen 1.8.0-20120409