# Changeset 699 for trunk/yat/statistics

Ignore:
Timestamp:
Oct 26, 2006, 3:54:20 PM (16 years ago)
Message:

fixed docs

File:
1 edited

### Legend:

Unmodified
 r683 /// /// The requirements for the types T1 and T2 of the arrays \a x /// and \a w are: operator[] returning an element and function /// size() returning the number of elements. /// and \a w are: operator[] returning an element and function /// size() returning the number of elements. /// template inline double mean(void) const { return sum_w() ? sum_wx()/sum_w() : 0; } /// /// @brief Weighted version of number of data points. If all /// /// @brief Weighted version of number of data points. /// /// If all /// weights are equal, the unweighted version is identical to the /// non-weighted version. Adding a data point with zero weight { return sum_wxx() - mean()*mean()*sum_w(); } /// /// The variance is calculated as \f$\frac{\sum w_i (x_i - m)^2 /// }{\sum w_i} \f$, where \a m is the known mean. /// /// @return Variance when the mean is known to be \a m. /// /** The variance is calculated as \f$\frac{\sum w_i (x_i - m)^2 }{\sum w_i} \f$, where \a m is the known mean. @return Variance when the mean is known to be \a m. */ inline double variance(const double m) const { return (sum_wxx()-2*m*sum_wx())/sum_w()+m*m; } /// /// The variance is calculated as \f$\frac{\sum w_i (x_i - m)^2 /// }{\sum w_i} \f$, where \a m is the mean(). Here the weight are /// interpreted as probability weights. For analytical weights the /// variance has no meaning as each data point has its own /// variance. /// /// @return The variance. /// /** The variance is calculated as \f$\frac{\sum w_i (x_i - m)^2 }{\sum w_i} \f$, where \a m is the mean(). Here the weight are interpreted as probability weights. For analytical weights the variance has no meaning as each data point has its own variance. @return The variance. */ inline double variance(void) const { return sum_xx_centered()/sum_w(); }