00001 #ifndef _theplu_yat_statistics_ttest_ 00002 #define _theplu_yat_statistics_ttest_ 00003 00004 // $Id: tTest.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2004, 2005 Peter Johansson 00008 Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér 00009 Copyright (C) 2007, 2008 Jari Häkkinen, 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 #include "AveragerWeighted.h" 00028 00029 #include <gsl/gsl_cdf.h> 00030 00031 namespace theplu { 00032 namespace yat { 00033 namespace statistics { 00034 00042 class tTest 00043 { 00044 00045 public: 00049 tTest(void); 00050 00051 00055 void add(double value, bool target, double weight=1.0); 00056 00062 void reset(void); 00063 00089 double score(void); 00090 00102 double p_value() const; 00103 00107 double p_value_one_sided(void) const; 00108 00109 private: 00110 00111 double dof_; 00112 bool updated_; 00113 double t_; 00114 AveragerWeighted pos_; 00115 AveragerWeighted neg_; 00116 00117 }; 00118 00119 }}} // of namespace statistics, yat, and theplu 00120 00121 #endif