Changeset 669


Ignore:
Timestamp:
Oct 7, 2006, 6:42:44 AM (15 years ago)
Author:
Peter
Message:

#closes #88. SAM score class added

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/c++_tools/statistics/Makefile.am

    r586 r669  
    3838  Polynomial.cc \
    3939  PolynomialWeighted.cc \
    40   ROC.cc Score.cc tScore.cc SNR.cc utility.cc \
     40  ROC.cc SAM.cc Score.cc SNR.cc tScore.cc utility.cc \
    4141  WilcoxonFoldChange.cc
    4242
     
    5555  Polynomial.h \
    5656  PolynomialWeighted.h \
    57   ROC.h Score.h SNR.h tScore.h \
     57  ROC.h SAM.h Score.h SNR.h tScore.h \
    5858  utility.h WilcoxonFoldChange.h
  • trunk/c++_tools/statistics/tScore.h

    r623 r669  
    3333    tScore(bool absolute=true);
    3434
    35     ///
    36     /// Calculates the value of t-score, i.e. the ratio between
    37     /// difference in mean and standard deviation of this
    38     /// difference. \f$ t = \frac{ m_x - m_y }
    39     /// {\frac{s^2}{n_x}+\frac{s^2}{n_y}} \f$ where \f$ m \f$ is the
    40     /// mean, \f$ n \f$ is the number of data points and \f$ s^2 =
    41     /// \frac{ \sum_i (x_i-m_x)^2 + \sum_i (y_i-m_y)^2 }{ n_x + n_y -
    42     /// 2 } \f$
    43     ///
    44     /// @return t-score if absolute=true absolute value of t-score
    45     /// is returned
    46     ///
     35   
     36    /**
     37       Calculates the value of t-score, i.e. the ratio between
     38       difference in mean and standard deviation of this
     39       difference. \f$ t = \frac{ m_x - m_y }
     40       {s\sqrt{\frac{1}{n_x}+\frac{1}{n_y}}} \f$ where \f$ m \f$ is the
     41       mean, \f$ n \f$ is the number of data points and \f$ s^2 =
     42       \frac{ \sum_i (x_i-m_x)^2 + \sum_i (y_i-m_y)^2 }{ n_x + n_y -
     43       2 } \f$
     44       
     45       @return t-score. If absolute=true absolute value of t-score
     46       is returned
     47    */
    4748    double score(const classifier::Target& target,
    4849                 const utility::vector& value);
    4950
    50     ///
    51     /// Calculates the weighted t-score, i.e. the ratio between
    52     /// difference in mean and standard deviation of this
    53     /// difference. \f$ t = \frac{ m_x - m_y }{
    54     /// \frac{s2}{n_x}+\frac{s2}{n_y}} \f$ where \f$ m \f$ is the
    55     /// weighted mean, n is the weighted version of number of data
    56     /// points and \f$ s2 \f$ is an estimation of the variance \f$ s^2
    57     /// = \frac{ \sum_i w_i(x_i-m_x)^2 + \sum_i w_i(y_i-m_y)^2 }{ n_x
    58     /// + n_y - 2 } \f$. See AveragerWeighted for details.
    59     ///
    60     /// @return t-score if absolute=true absolute value of t-score
    61     /// is returned
    62     ///
     51    /**
     52       Calculates the weighted t-score, i.e. the ratio between
     53       difference in mean and standard deviation of this
     54       difference. \f$ t = \frac{ m_x - m_y }{
     55       s\sqrt{\frac{1}{n_x}+\frac{1}{n_y}}} \f$ where \f$ m \f$ is the
     56       weighted mean, n is the weighted version of number of data
     57       points \f$ \frac{\left(\sum w_i\right)^2}{\sum w_i^2} \f$, and
     58       \f$ s^2 \f$ is an estimation of the variance \f$ s^2 = \frac{
     59       \sum_i w_i(x_i-m_x)^2 + \sum_i w_i(y_i-m_y)^2 }{ n_x + n_y - 2
     60       } \f$. See AveragerWeighted for details.
     61       
     62       @return t-score. If absolute=true absolute value of t-score
     63       is returned
     64    */
    6365    double score(const classifier::Target& target,
    6466                 const classifier::DataLookupWeighted1D& value);
  • trunk/test/score_test.cc

    r616 r669  
    11// $Id$
    22
     3#include <c++_tools/statistics/FoldChange.h>
     4#include <c++_tools/statistics/Pearson.h>
    35#include <c++_tools/statistics/ROC.h>
     6#include <c++_tools/statistics/SAM.h>
    47#include <c++_tools/statistics/tScore.h>
    5 #include <c++_tools/statistics/Pearson.h>
    6 #include <c++_tools/statistics/FoldChange.h>
    78#include <c++_tools/statistics/WilcoxonFoldChange.h>
    89#include <c++_tools/utility/matrix.h>
     
    119120  statistics::WilcoxonFoldChange wfc(true);
    120121
     122  *error << "testing SAM" << std::endl;
     123  statistics::SAM sam(1.0,true);
     124
    121125
    122126  if (ok)
Note: See TracChangeset for help on using the changeset viewer.