Changeset 400


Ignore:
Timestamp:
Oct 18, 2005, 5:37:09 PM (16 years ago)
Author:
Peter
Message:

cleaning up AveragerWeighted?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/statistics/AveragerWeighted.h

    r398 r400  
    6767
    6868    ///
    69     /// Calculating the squared error according to: \f$ \frac{\sum
    70     /// w_i^2(x_i-m)^2}{(\sum w_i)^2} \f$
    71     ///
    72     /// @return squared error
    73     ///
    74     inline double squared_error(void) const
    75     { return (squared_sum()) / (sum_w()*sum_w()); }
    76 
    77     ///
    7869    /// The standard error is calculated as \f$ \sqrt{\frac{\sum
    7970    /// w_i^2}{(\sum w_i)^2-\sum w_i^2}\frac{\sum w_i(x_i-m)^2}{\sum
     
    9586
    9687    ///
    97     /// Calculating the squared sum 
    98     ///
    99     /// @return \f$ \sum w_i^2(x_i-m)^2 \f$
    100     ///
    101     inline double squared_sum(void) const
    102     { return (sum_wwxx()-2*mean()*wwx_+ mean()*mean()*sum_ww()) ; }
    103 
    104     ///
    10588    /// Calculating the sum of weights: \f$ \sum
    10689    /// w_i \f$ @return sum of weights
     
    10891    inline double sum_w(void) const
    10992    { return w_.sum_x(); }
    110 
    111     ///
    112     /// \f$ \sum w_ix_i \f$ @return weighted sum of x
    113     ///
    114     inline double sum_wx(void)  const
    115     { return wx_.sum_x(); }
    11693
    11794    ///
     
    125102    { return sum_ww() / (sum_w()*sum_w()-sum_ww()) * sum_xx_centered(); }
    126103
    127     ///
    128     /// @return \f$ \sum_i w_i (x_i-m)^2\f$
    129     ///
    130     inline double sum_xx_centered(void) const
    131     { return sum_wxx() - mean()*mean()*sum_w(); }
    132104
    133105  private:
     106    ///
     107    /// \f$ \sum w_ix_i \f$ @return weighted sum of x
     108    ///
     109    inline double sum_wx(void)  const
     110    { return wx_.sum_x(); }
     111
    134112    inline double sum_ww(void)  const
    135113    { return w_.sum_xsqr(); }
     114
    136115    ///
    137116    ///  @return \f$ \sum w_i^2x_i^2 \f$
     
    150129    ///
    151130    inline double sum_wxx(void) const { return wxx_; }
     131
     132    ///
     133    /// @return \f$ \sum_i w_i (x_i-m)^2\f$
     134    ///
     135    inline double sum_xx_centered(void) const
     136    { return sum_wxx() - mean()*mean()*sum_w(); }
    152137
    153138    ///
Note: See TracChangeset for help on using the changeset viewer.