source: trunk/lib/statistics/SNR.h @ 532

Last change on this file since 532 was 532, checked in by Peter, 16 years ago

modified implementation of Parson weighted - now in line with other weighted statistics.

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