# source:trunk/lib/statistics/SNR.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 Id
File size: 1.3 KB
Line
1// $Id: SNR.h 529 2006-03-01 14:03:27Z markus$
2
3#ifndef _theplu_statistics_snr
4#define _theplu_statistics_snr
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 score based on signal-to-noise ratio (SNR).  Also
19  /// sometimes referred to as Golub score. The score is the ratio
20  /// between difference in mean and the sum of standard deviations
21  /// for two groups.  \f$\frac{ \frac{1}{n_x}\sum x_i - 22 /// \frac{1}{n_y}\sum y_i }{ \sigma_x + \sigma_y} \f$ where \f$23 /// \sigma \f$ is standard deviation.
24  ///
25  class SNR : public Score
26  {
27
28  public:
29    ///
30    /// Default Constructor.
31    ///
32    SNR(bool absolute=true);
33
34    ///
35    /// Calculates the value of SNR score. @return SNR score if
36    /// absolute=true absolute value of t-score is returned
37    ///
38    double score(const classifier::Target& target,
39                 const gslapi::vector& value);
40
41    ///
42    /// Weighted version of SNR @return t-score if absolute=true
43    /// absolute value of t-score is returned.
44    ///
45    double score(const classifier::Target& target,
46                 const gslapi::vector& value,
47                 const gslapi::vector& weight);
48  private:
49    double score_;
50  };
51
52}} // of namespace statistics and namespace theplu
53
54#endif
55
Note: See TracBrowser for help on using the repository browser.