Changeset 191


Ignore:
Timestamp:
Oct 26, 2004, 2:59:47 PM (18 years ago)
Author:
Peter
Message:

more simplistic interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/AveragerPair.h

    r180 r191  
    6767
    6868    ///
    69     /// @return average of x
    70     ///
    71     inline double average_x(void) const {return x_.average();}
    72 
    73     ///
    74     /// @return average of y
    75     ///
    76     inline double average_y(void) const {return y_.average();}
    77 
    78     ///
    79     /// @return sum of squared values \f$ \sum x_i^2 \f$
    80     ///
    81     inline double average_sqrx(void) const {return x_.average_sqr();}
    82 
    83     ///
    84     /// @return sum of squared values \f$ \sum y_i^2 \f$
    85     ///
    86     inline double average_sqry(void) const {return y_.average_sqr();}
    87 
    88     ///
    8969    /// \f$\frac{\sum_i (x_i-m_x)(y_i-m_y)}{\sqrt{\sum_i
    9070    /// (x_i-m_x)^2\sum_i (y_i-m_y)^2}}\f$
     
    10585 
    10686    ///
    107     /// @return average \f$ \frac{\sum x_i}{n} \f$
     87    /// @return number of pair of data points
    10888    ///
    109     inline double mean_x(void) const { return x_.mean(); }
    110  
    111     ///
    112     /// @return average \f$ \frac{\sum y_i}{n} \f$
    113     ///
    114     inline double mean_y(void) const { return y_.mean(); }
    115  
    116     ///
    117     /// @return @return sum of squared values \f$ \sum x_i^2 \f$.
    118     ///
    119     inline double mean_sqrx(void) const { return x_.mean_sqr(); }
     89    inline long n(void) const { return x_.n(); }
    12090
    12191    ///
    122     /// @return @return sum of squared values \f$ \sum y_i^2 \f$.
     92    /// @return mean of xy
    12393    ///
    124     inline double mean_sqry(void) const { return y_.mean_sqr(); }
     94    inline double mean_xy(void) const { return xy_/n(); }
    12595
    12696    ///
    127     /// @return number of data points
     97    /// @return average squared difference between x and y \f$
     98    /// \frac{1}{N} \sum (x-y)^2 \f$
    12899    ///
    129     inline double n(void) const { return x_.n(); }
     100    inline double mse(void) { return x_.mean_sqr()+y_.mean_sqr()-2*mean_xy(); }
    130101
    131102    ///
     
    135106
    136107    ///
    137     /// The standard deviation is defined as the square root of the
    138     /// variance. @return standard deviation of x
    139     ///
    140     inline double standard_deviation_x(void) const {  return x_.std(); }
    141 
    142     ///
    143     /// The standard deviation is defined as the square root of the
    144     /// variance. @return standard deviation of y
    145     ///
    146     inline double standard_deviation_y(void) const {  return y_.std(); }
    147 
    148     ///
    149     /// The standard deviation is defined as the square root of the
    150     /// variance. @return standard deviation of x
    151     ///
    152     inline double std_x(void) const {  return x_.std(); }
    153 
    154     ///
    155     /// The standard deviation is defined as the square root of the
    156     /// variance. @return standard deviation of y
    157     ///
    158     inline double std_y(void) const {  return y_.std(); }
    159 
    160     ///
    161     /// @return standard error of x, i.e. standard deviation of the mean
    162     ///
    163     inline double standard_error_x(void) const { return x_.standard_error(); }
    164 
    165     ///
    166     /// @return standard error of y, i.e. standard deviation of the mean
    167     ///
    168     inline double standard_error_y(void) const { return y_.standard_error(); }
    169 
    170     ///
    171     /// @return the sum of x
    172     ///
    173     inline double sum_x(void) const { return x_.sum_x(); }
    174 
    175     ///
    176     /// @return the sum of y
    177     ///
    178     inline double sum_y(void) const { return y_.sum_x(); }
    179 
    180     ///
    181     /// @return the sum of x squared
    182     ///
    183     inline double sum_sqr_x(void) const { return x_.sum_xsqr(); }
    184 
    185     ///
    186     /// @return the sum of y squared
    187     ///
    188     inline double sum_sqr_y(void) const { return y_.sum_xsqr(); }
    189 
    190     ///
    191108    /// @return the sum of xy
    192109    ///
    193110    inline double sum_xy(void) const { return xy_; }
    194 
    195     ///
    196     /// The variance is calculated using the (n-1) correction, so the
    197     /// expectation value is unbiased @return variance x
    198     ///
    199     inline double variance_x(void) const
    200     { return x_.variance(); }
    201 
    202     ///
    203     /// The variance is calculated using the (n-1) correction, so the
    204     /// expectation value is unbiased @return variance of y
    205     ///
    206     inline double variance_y(void) const
    207     { return y_.variance(); }
    208111
    209112    ///
Note: See TracChangeset for help on using the changeset viewer.