source: trunk/lib/statistics/tScore.h @ 529

Last change on this file since 529 was 529, checked in by Markus Ringnér, 16 years ago

Added score for signal-to-noise ratio (Golub score). Fixed documentation. Improved weighted version of tScore

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1// $Id: tScore.h 529 2006-03-01 14:03:27Z markus $
2
3#ifndef _theplu_statistics_t_score_
4#define _theplu_statistics_t_score_
5
6// C++ tools include
7/////////////////////
8#include <c++_tools/statistics/Score.h>
9#include <c++_tools/gslapi/vector.h>
10
11#include <gsl/gsl_cdf.h>
12
13
14namespace theplu {
15namespace statistics { 
16
17  ///
18  /// Class for Fisher's t-test.
19  ///   
20  class tScore : public Score
21  {
22 
23  public:
24    ///
25    /// Default Constructor.
26    ///
27    tScore(bool absolute=true);
28
29    ///
30    /// Calculates the value of t-score, i.e. the ratio between
31    /// difference in mean and standard deviation of this
32    /// difference. \f$ \frac{ \vert \frac{1}{n_x}\sum x_i -
33    /// \frac{1}{n_y}\sum y_i \vert } {\frac{\sum (x_i-m_x)^2 + \sum
34    /// (y_i-m_y)^2}{n_x-1+n_y-1}} \f$
35    ///
36    /// @return t-score if absolute=true
37    /// absolute value of t-score is returned
38    ///
39    double score(const classifier::Target& target, 
40                 const gslapi::vector& value); 
41
42    ///
43    /// Weighted version of t-Score @return t-score if absolute=true
44    /// absolute value of t-score is returned.
45    /// @todo Peter: This is probably
46    /// not implemented as it should be!
47    ///
48    double score(const classifier::Target& target, 
49                 const gslapi::vector& value, 
50                 const gslapi::vector& weight); 
51
52    ///
53    ///Calculates the p-value, i.e. the probability of observing a
54    ///t-score equally or larger if the null hypothesis is true. If P
55    ///is near zero, this casts doubt on this hypothesis. The null
56    ///hypothesis is ...  @return the one-sided p-value( if
57    ///absolute=true is used the two-sided p-value)
58    ///
59    double p_value() const;
60
61         
62         
63  private:
64    double t_;
65    int dof_;
66       
67  };
68
69}} // of namespace statistics and namespace theplu
70
71#endif
72
Note: See TracBrowser for help on using the repository browser.