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:eolstyle set to
native

Property svn:keywords set to
Id

File size:
1.3 KB

Line  

1  // $Id: SNR.h 532 20060302 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  

14  namespace theplu { 

15  namespace statistics { 

16  

17  /// 

18  /// @brief Class for score based on signaltonoise 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 tscore is returned 

39  /// 

40  double score(const classifier::Target& target, 

41  const gslapi::vector& value); 

42  

43  /// 

44  /// Weighted version of SNR @return tscore if absolute=true 

45  /// absolute value of tscore 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.