Ignore:
Timestamp:
Dec 26, 2006, 10:56:26 AM (16 years ago)
Author:
Jari Häkkinen
Message:

Addresses #170.

File:
1 edited

Legend:

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

    r705 r718  
    8585    /// @return Concordence correlation coefficient.
    8686    ///
    87     inline double ccc(void) const
    88     { return ( (x_.variance() && y_.variance() && (x_.mean()-y_.mean()) ) ?
    89                  ((2*covariance()) /
    90                   ((x_.variance()+y_.variance()) +
    91                    (x_.mean()-y_.mean())*(x_.mean()-y_.mean()))) : 0); }
    92  
     87    double ccc(void) const;
     88
    9389    ///
    9490    /// \f$ \frac{\sum_i (x_i-m_x)(y_i-m_y)}{\sqrt{\sum_i
     
    9793    /// @return Pearson correlation coefficient.
    9894    ///
    99     inline double correlation(void) const
    100       { return ((x_.std()>0 && y_.std()>0) ?
    101                 (covariance() / (x_.std()*y_.std()) ) : 0); }
     95    double correlation(void) const;
    10296 
    10397    ///
     
    108102    /// @return The covariance.
    109103    ///
    110     inline double covariance(void) const
    111       { return (n()>1) ? (xy_ - x_.sum_x()*y_.mean()) / n(): 0; }
     104    double covariance(void) const;
    112105 
    113106    ///
    114107    /// @return The mean of xy.
    115108    ///
    116     inline double mean_xy(void) const { return xy_/n(); }
     109    double mean_xy(void) const;
    117110
    118111    ///
     
    120113    /// \frac{1}{N} \sum (x-y)^2 \f$
    121114    ///
    122     inline double msd() const
    123     {return ( x_averager().sum_xx()+y_averager().sum_xx()-2*sum_xy() )/n();}
     115    double msd(void) const;
    124116
    125117    ///
    126118    /// @return The number of pair of data points.
    127119    ///
    128     inline unsigned long n(void) const { return x_.n(); }
     120    unsigned long n(void) const;
    129121
    130122    ///
     
    136128    /// @return The sum of xy.
    137129    ///
    138     inline double sum_xy(void) const { return xy_; }
     130    double sum_xy(void) const;
    139131
    140132    ///
    141133    /// @return \f$ \sum_i (x_i-m_x)(y_i-m_y) \f$
    142134    ///
    143     inline double sum_xy_centered(void) const {return xy_-x_.sum_x()*y_.mean();}
     135    double sum_xy_centered(void) const;
    144136
    145137    ///
    146138    /// @return A const refencer to the averager object for x.
    147139    ///
    148     inline const Averager& x_averager(void) const { return x_; }
     140    const Averager& x_averager(void) const;
    149141
    150142    ///
    151143    /// @return A const reference to the averager object for y
    152144    ///
    153     inline const Averager& y_averager(void) const { return y_; }
     145    const Averager& y_averager(void) const;
    154146
    155147    ///
Note: See TracChangeset for help on using the changeset viewer.