Changeset 699 for trunk/yat/statistics
 Timestamp:
 Oct 26, 2006, 3:54:20 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/statistics/AveragerWeighted.h
r683 r699 89 89 /// 90 90 /// The requirements for the types T1 and T2 of the arrays \a x 91 92 91 /// and \a w are: operator[] returning an element and function 92 /// size() returning the number of elements. 93 93 /// 94 94 template <typename T1, typename T2> … … 102 102 inline double mean(void) const { return sum_w() ? 103 103 sum_wx()/sum_w() : 0; } 104 105 /// 106 /// @brief Weighted version of number of data points. If all 104 105 /// 106 /// @brief Weighted version of number of data points. 107 /// 108 /// If all 107 109 /// weights are equal, the unweighted version is identical to the 108 110 /// nonweighted version. Adding a data point with zero weight … … 174 176 { return sum_wxx()  mean()*mean()*sum_w(); } 175 177 176 / //177 ///The variance is calculated as \f$ \frac{\sum w_i (x_i  m)^2178 ///}{\sum w_i} \f$, where \a m is the known mean.179 ///180 ///@return Variance when the mean is known to be \a m.181 ///178 /** 179 The variance is calculated as \f$ \frac{\sum w_i (x_i  m)^2 180 }{\sum w_i} \f$, where \a m is the known mean. 181 182 @return Variance when the mean is known to be \a m. 183 */ 182 184 inline double variance(const double m) const 183 185 { return (sum_wxx()2*m*sum_wx())/sum_w()+m*m; } 184 186 185 / //186 ///The variance is calculated as \f$ \frac{\sum w_i (x_i  m)^2187 ///}{\sum w_i} \f$, where \a m is the mean(). Here the weight are188 ///interpreted as probability weights. For analytical weights the189 ///variance has no meaning as each data point has its own190 ///variance.191 ///192 ///@return The variance.193 ///187 /** 188 The variance is calculated as \f$ \frac{\sum w_i (x_i  m)^2 189 }{\sum w_i} \f$, where \a m is the mean(). Here the weight are 190 interpreted as probability weights. For analytical weights the 191 variance has no meaning as each data point has its own 192 variance. 193 194 @return The variance. 195 */ 194 196 inline double variance(void) const 195 197 { return sum_xx_centered()/sum_w(); }
Note: See TracChangeset
for help on using the changeset viewer.