source: trunk/src/tScore.h @ 98

Last change on this file since 98 was 98, checked in by Peter, 19 years ago

tScore added

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1// $Id: tScore.h 98 2004-06-10 15:24:05Z peter $
2
3#ifndef _theplu_cpptools_t_score_
4#define _theplu_cpptools_t_score_
5
6// C++ tools include
7/////////////////////
8#include "Score.h"
9#include "vector.h"
10#include <gsl/gsl_cdf.h>
11
12// Standard C++ includes
13////////////////////////
14//#include <utility>
15//#include <vector>
16
17namespace theplu {
18namespace cpptools { 
19  ///
20  /// Class for Fisher's t-test.
21  ///   
22 
23  class tScore : public Score
24  {
25 
26  public:
27    ///
28    /// Constructor taking a value vector and a target vector (+1 or -1).
29    ///
30    tScore(const gslapi::vector&, const gslapi::vector&);
31         
32    ///
33    /// Destructor
34    ///
35    virtual ~tScore(void) {};
36         
37   
38    ///
39    /// Calculates the t-score, i.e. the ratio between difference in
40    /// mean and standard deviation of this difference.
41    /// @return \f$ \frac{\frac{1}{n_x}\sum x_i - \frac{1}{n_y}\sum y_i}
42    /// {\frac{\sum x_i^2 + \sum y_i^2}{n_x-1+n_y-1}} \f$
43    ///
44    double score();
45       
46    ///
47    ///Calculates the p-value, i.e. the probability of observing a t-score
48    ///equally or larger if the null hypothesis is true. If P is near zero,
49    ///this casts doubt on this hypothesis. The null hypothesis is ...
50    /// @return the one-sided p-value
51    ///
52    double p_value();
53         
54  private:
55    gslapi::vector value_;
56    gslapi::vector target_;
57   
58       
59  };
60
61}} // of namespace cpptools and namespace theplu
62
63#endif
64
Note: See TracBrowser for help on using the repository browser.