source: trunk/yat/statistics/SNRScore.h @ 1706

Last change on this file since 1706 was 1487, checked in by Jari Häkkinen, 13 years ago

Addresses #436. GPL license copy reference should also be updated.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#ifndef _theplu_yat_statistics_snr
2#define _theplu_yat_statistics_snr
3
4// $Id: SNRScore.h 1487 2008-09-10 08:41:36Z jari $
5
6/*
7  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson, Markus Ringnér
8  Copyright (C) 2008 Peter Johansson
9
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#include "Score.h"
27
28#include <gsl/gsl_cdf.h>
29
30namespace theplu {
31  namespace yat {
32    namespace utility {
33      class VectorBase;
34    }
35    namespace classifier {
36      class DataLookWeighted1D;
37    }
38    namespace statistics { 
39
40      /**
41         @brief Class for score based on signal-to-noise ratio (SNRScore). 
42         
43         Also
44         sometimes referred to as Golub score. The score is the ratio
45         between difference in mean and the sum of standard deviations
46         for two groups:  \f$ \frac{ m_x-m_y}{ s_x + s_y} \f$ where \f$
47         s \f$ is standard deviation.
48      */
49      class SNRScore : public Score
50      {
51       
52      public:
53        ///
54        /// @brief Default Constructor.
55        ///
56        SNRScore(bool absolute=true);
57       
58        ///
59        /// @brief The destructor.
60        ///
61        virtual ~SNRScore(void);
62       
63        /**
64           SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m
65           \f$ and \f$ s \f$ are mean and standard deviation,
66           respectively. @see Averager
67           
68           @return SNRScore score. If absolute=true absolute value of SNRScore is
69           returned
70        */
71        double score(const classifier::Target& target, 
72                     const utility::VectorBase& value) const; 
73       
74        /**
75           SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m
76           \f$ and \f$ s \f$ are weighted versions of mean and standard
77           deviation, respectively. @see AveragerWeighted
78           
79           @return SNRScore score. If absolute=true absolute value of SNRScore is
80           returned
81        */
82        double score(const classifier::Target& target,
83                     const classifier::DataLookupWeighted1D& value) const;         
84       
85        /**
86           SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m
87           \f$ and \f$ s \f$ are weighted versions of mean and standard
88           deviation, respectively. @see AveragerWeighted
89           
90           @return SNRScore score. If absolute=true absolute value of SNRScore is
91           returned
92        */
93        double score(const classifier::Target& target, 
94                     const utility::VectorBase& value, 
95                     const utility::VectorBase& weight) const;         
96       
97      };
98     
99     
100    }}} // of namespace statistics, yat, and theplu
101
102#endif
Note: See TracBrowser for help on using the repository browser.