yat  0.14.5pre
Public Member Functions | Protected Attributes | List of all members
theplu::yat::statistics::SAMScore Class Reference

Class for score used in Significance Analysis of Microarrays (SAM). More...

#include <yat/statistics/SAMScore.h>

Inheritance diagram for theplu::yat::statistics::SAMScore:
theplu::yat::statistics::Score

Public Member Functions

 SAMScore (const double s0, bool absolute=true)
 
double score (const classifier::Target &target, const utility::VectorBase &value) const
 
double score (const classifier::Target &target, const classifier::DataLookupWeighted1D &value) const
 
double score (const classifier::Target &target, const utility::VectorBase &value, const utility::VectorBase &weight) const
 
void absolute (bool absolute)
 Function changing mode of Score.
 
virtual double score (const classifier::Target &target, const classifier::DataLookup1D &value) const
 
double score (const classifier::Target &target, const classifier::DataLookup1D &value, const classifier::DataLookup1D &weight) const
 

Protected Attributes

bool absolute_
 

Detailed Description

Class for score used in Significance Analysis of Microarrays (SAM).

The score is similar to the Student t-test but with an added fudge factor in denominator to avoid groups with small variance getting a large score. $ \frac{m_x-m_y}{s+s_0} $

see http://www.pnas.org/cgi/content/abstract/98/9/5116 for details

Constructor & Destructor Documentation

theplu::yat::statistics::SAMScore::SAMScore ( const double  s0,
bool  absolute = true 
)
Parameters
s0$ s_0 $ is a fudge factor
absoluteif true max(score, -score) is used

Member Function Documentation

double theplu::yat::statistics::SAMScore::score ( const classifier::Target target,
const utility::VectorBase value 
) const
virtual

$ \frac{m_x-m_y}{s+s_0} $ where $ m = \frac{1}{n_x}\sum x_i $, $ s^2 = \left(\frac{1}{n_x}+\frac{1}{n_y} \right) \frac{\sum (x_i-m_x)^2 + \sum(y_i-m_y)^2}{n_x+n_y-2} $, and $ s_0 $ is the fudge factor.

Returns
SAM score. If absolute=true absolute value of t-score is returned

Implements theplu::yat::statistics::Score.

virtual double theplu::yat::statistics::Score::score ( const classifier::Target target,
const classifier::DataLookup1D value 
) const
virtualinherited

Function calculating the score. In absolute mode, also the score using negated class labels is calculated, and the largest of the two scores are calculated.

value is copied to a utility::vector and that operator is called. If speed is important this operator should be implemented in inherited class to avoid copying.

Returns
score
double theplu::yat::statistics::SAMScore::score ( const classifier::Target target,
const classifier::DataLookupWeighted1D value 
) const
virtual

$ \frac{m_x-m_y}{s+s_0} $ where $ m = \frac{\sum w_ix_i}{w_i} $, $ s_0 $ is the fudge factor, and $ s^2 = \left(\frac{1}{n_x}+\frac{1}{n_y} \right) \frac{\sum w_i(x_i-m_x)^2 + \sum w_i(y_i-m_y)^2}{n_x+n_y-2} $ where $ n $ is weighted version of number of data points $ \frac{\left(\sum w_i\right)^2}{\sum w_i^2} $.

Returns
weighted version of SAM score. If absolute=true absolute value is returned

Reimplemented from theplu::yat::statistics::Score.

double theplu::yat::statistics::SAMScore::score ( const classifier::Target target,
const utility::VectorBase value,
const utility::VectorBase weight 
) const
virtual

$ \frac{m_x-m_y}{s+s_0} $ where $ m = \frac{\sum w_ix_i}{w_i} $, $ s_0 $ is the fudge factor, and $ s^2 = \left(\frac{1}{n_x}+\frac{1}{n_y} \right) \frac{\sum w_i(x_i-m_x)^2 + \sum w_i(y_i-m_y)^2}{n_x+n_y-2} $ where $ n $ is weighted version of number of data points $ \frac{\left(\sum w_i\right)^2}{\sum w_i^2} $.

Returns
weighted version of SAM score. If absolute=true absolute value is returned

Implements theplu::yat::statistics::Score.

double theplu::yat::statistics::Score::score ( const classifier::Target target,
const classifier::DataLookup1D value,
const classifier::DataLookup1D weight 
) const
inherited

Function calculating the weighted version of score. In absolute mode, also the score using negated class labels is calculated, and the largest of the two scores are calculated. Absolute mode should be used when two-tailed test is wanted.

value and weight are copied to utility::vector and the corresponding operator is called. If speed is important this operator should be implemented in inherited class to avoid copying.

Member Data Documentation

bool theplu::yat::statistics::Score::absolute_
protectedinherited

true if method is absolute, which means if score is below expected value (by chance) E, score returns E-score+E instead.


The documentation for this class was generated from the following file:

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5