Changeset 118


Ignore:
Timestamp:
Jul 20, 2004, 4:06:19 PM (18 years ago)
Author:
Peter
Message:

squared_sum() added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/WeightedAverager.h

    r104 r118  
    6161    ///
    6262    inline double squared_error(void) const
     63    { return (squared_sum()) / (sum_w()*sum_w()); }
     64
     65    ///
     66    /// Calculating the squared sum according to: \f$ \sum
     67    /// w_i^2(x_i-m)^2} \f$ @return squared error
     68    ///
     69    inline double squared_sum(void) const
    6370    { return (sum_wwxx()-2*mean()*wwx_+
    64               mean()*mean()*sum_ww()) / (sum_w()*sum_w()); }
     71              mean()*mean()*sum_ww()) ; }
    6572
    6673    ///
Note: See TracChangeset for help on using the changeset viewer.