Changeset 772


Ignore:
Timestamp:
Feb 25, 2007, 7:29:47 PM (15 years ago)
Author:
Peter
Message:

fixes #126 and added some functions in AveragerPair? and AveragerPairWeighted?

Location:
trunk/yat/statistics
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/AveragerPair.cc

    r718 r772  
    7272  double AveragerPair::msd(void) const
    7373  {
    74     return ( x_averager().sum_xx()+y_averager().sum_xx()-2*sum_xy() )/n();
     74    return sum_squared_deviation()/n();
    7575  }
    7676
     
    8989    x_=a.x_; y_=a.y_; xy_=a.xy_;
    9090    return *this;
     91  }
     92
     93  double AveragerPair::sum_squared_deviation(void) const
     94  {
     95    return x_averager().sum_xx()+y_averager().sum_xx()-2*sum_xy() ;
    9196  }
    9297
  • trunk/yat/statistics/AveragerPair.h

    r767 r772  
    130130
    131131    ///
     132    /// @return Sum of squared deviation between x and y \f$
     133    /// \sum (x-y)^2 \f$
     134    ///
     135    double sum_squared_deviation(void) const;
     136
     137    ///
    132138    /// @return \f$ \sum_i (x_i-m_x)(y_i-m_y) \f$
    133139    ///
  • trunk/yat/statistics/AveragerPairWeighted.cc

    r718 r772  
    9090
    9191
     92  double AveragerPairWeighted::msd(void) const
     93  {
     94    return ( x_.sum_wxx()+y_.sum_wxx()-2*wxy_)/w_;
     95  }
     96
     97
    9298  void AveragerPairWeighted::reset(void)
    9399  {
  • trunk/yat/statistics/AveragerPairWeighted.h

    r767 r772  
    120120    double covariance(void) const;
    121121
     122    /**
     123       @return \f$ \frac{\sum w_xw_y(x-y)^2}{\sum w_xw_y} \f$
     124    */
     125    double msd(void) const;
     126
    122127    ///
    123128    /// @brief Reset everything to zero
  • trunk/yat/statistics/AveragerWeighted.h

    r757 r772  
    163163
    164164    ///
     165    ///  @return \f$ \sum w_i x_i^2 \f$
     166    ///
     167    double sum_wxx(void) const;
     168
     169    ///
    165170    /// @return \f$ \sum_i w_i (x_i-m)^2\f$
    166171    ///
     
    198203    double sum_wwxx(void) const;
    199204   
    200     ///
    201     ///  @return \f$ \sum w_i x_i^2 \f$
    202     ///
    203     double sum_wxx(void) const;
    204 
    205205    const Averager& wx(void) const;
    206206    const Averager& w(void) const;
  • trunk/yat/statistics/Makefile.am

    r683 r772  
    2626libstatistics_la_SOURCES = Averager.cc AveragerPair.cc      \
    2727  AveragerWeighted.cc AveragerPairWeighted.cc Distance.cc   \
    28   Fisher.cc FoldChange.cc Histogram.cc Pearson.cc     \
     28  Euclidean.cc Fisher.cc FoldChange.cc Histogram.cc Pearson.cc      \
    2929  PearsonDistance.cc ROC.cc SAM.cc Score.cc SNR.cc tScore.cc  \
    3030  utility.cc WilcoxonFoldChange.cc
     
    3333
    3434include_statistics_HEADERS = Averager.h AveragerPair.h      \
    35   AveragerWeighted.h AveragerPairWeighted.h Distance.h Fisher.h \
     35  AveragerWeighted.h AveragerPairWeighted.h Distance.h Euclidean.h \
     36  Fisher.h  \
    3637  FoldChange.h Histogram.h Pearson.h PearsonDistance.h ROC.h  \
    3738  SAM.h Score.h SNR.h tScore.h utility.h WilcoxonFoldChange.h
Note: See TracChangeset for help on using the changeset viewer.