# Changeset 400

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

cleaning up AveragerWeighted?

File:
1 edited

### Legend:

Unmodified
 r398 /// /// Calculating the squared error according to: \f$\frac{\sum /// w_i^2(x_i-m)^2}{(\sum w_i)^2} \f$ /// /// @return squared error /// inline double squared_error(void) const { return (squared_sum()) / (sum_w()*sum_w()); } /// /// The standard error is calculated as \f$\sqrt{\frac{\sum /// w_i^2}{(\sum w_i)^2-\sum w_i^2}\frac{\sum w_i(x_i-m)^2}{\sum /// /// Calculating the squared sum /// /// @return \f$ \sum w_i^2(x_i-m)^2 \f$/// inline double squared_sum(void) const { return (sum_wwxx()-2*mean()*wwx_+ mean()*mean()*sum_ww()) ; } /// /// Calculating the sum of weights: \f$ \sum /// w_i \f$@return sum of weights inline double sum_w(void) const { return w_.sum_x(); } /// /// \f$ \sum w_ix_i \f$@return weighted sum of x /// inline double sum_wx(void) const { return wx_.sum_x(); } /// { return sum_ww() / (sum_w()*sum_w()-sum_ww()) * sum_xx_centered(); } /// /// @return \f$ \sum_i w_i (x_i-m)^2\f$/// inline double sum_xx_centered(void) const { return sum_wxx() - mean()*mean()*sum_w(); } private: /// /// \f$ \sum w_ix_i \f$@return weighted sum of x /// inline double sum_wx(void) const { return wx_.sum_x(); } inline double sum_ww(void) const { return w_.sum_xsqr(); } /// /// @return \f$ \sum w_i^2x_i^2 \f$/// inline double sum_wxx(void) const { return wxx_; } /// /// @return \f$ \sum_i w_i (x_i-m)^2\f\$ /// inline double sum_xx_centered(void) const { return sum_wxx() - mean()*mean()*sum_w(); } ///