source: trunk/yat/statistics/SNR.h @ 831

Last change on this file since 831 was 831, checked in by Peter, 14 years ago

Refs #185.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1#ifndef _theplu_yat_statistics_snr
2#define _theplu_yat_statistics_snr
3
4// $Id: SNR.h 831 2007-03-27 13:22:09Z peter $
5
6/*
7  Copyright (C) 2006 Jari Häkkinen, Markus Ringnér, Peter Johansson
8  Copyright (C) 2007 Peter Johansson
9
10  This file is part of the yat library, http://lev.thep.lu.se/trac/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 2 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 this program; if not, write to the Free Software
24  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25  02111-1307, USA.
26*/
27
28#include "Score.h"
29
30#include <gsl/gsl_cdf.h>
31
32namespace theplu {
33namespace yat {
34  namespace utility {
35    class vector;
36  }
37  namespace classifier {
38    class DataLookWeighted1D;
39  }
40namespace statistics { 
41
42  /**
43     @brief Class for score based on signal-to-noise ratio (SNR). 
44     
45     Also
46     sometimes referred to as Golub score. The score is the ratio
47     between difference in mean and the sum of standard deviations
48     for two groups:  \f$ \frac{ m_x-m_y}{ s_x + s_y} \f$ where \f$
49     s \f$ is standard deviation.
50  */
51  class SNR : public Score
52  {
53 
54  public:
55    ///
56    /// @brief Default Constructor.
57    ///
58    SNR(bool absolute=true);
59
60    /**
61       SNR is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m
62       \f$ and \f$ s \f$ are mean and standard deviation,
63       respectively. @see Averager
64
65       @return SNR score. If absolute=true absolute value of SNR is
66       returned
67    */
68    double score(const classifier::Target& target, 
69                 const utility::vector& value); 
70
71    /**
72       SNR is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m
73       \f$ and \f$ s \f$ are weighted versions of mean and standard
74       deviation, respectively. @see AveragerWeighted
75
76       @return SNR score. If absolute=true absolute value of SNR is
77       returned
78    */
79    double score(const classifier::Target& target, 
80                 const classifier::DataLookupWeighted1D& value);         
81
82    /**
83       SNR is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m
84       \f$ and \f$ s \f$ are weighted versions of mean and standard
85       deviation, respectively. @see AveragerWeighted
86
87       @return SNR score. If absolute=true absolute value of SNR is
88       returned
89    */
90    double score(const classifier::Target& target, 
91                 const utility::vector& value, 
92                 const utility::vector& weight);         
93  private:
94    double score_;
95  };
96
97}}} // of namespace statistics, yat, and theplu
98
99#endif
Note: See TracBrowser for help on using the repository browser.