summaryrefslogtreecommitdiff
path: root/boost/accumulators/statistics/weighted_variance.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/statistics/weighted_variance.hpp')
-rw-r--r--boost/accumulators/statistics/weighted_variance.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/boost/accumulators/statistics/weighted_variance.hpp b/boost/accumulators/statistics/weighted_variance.hpp
index e91fdc1bc6..bc199affa4 100644
--- a/boost/accumulators/statistics/weighted_variance.hpp
+++ b/boost/accumulators/statistics/weighted_variance.hpp
@@ -41,7 +41,7 @@ namespace impl
{
typedef typename numeric::functional::multiplies<Sample, Weight>::result_type weighted_sample;
// for boost::result_of
- typedef typename numeric::functional::average<weighted_sample, Weight>::result_type result_type;
+ typedef typename numeric::functional::fdiv<weighted_sample, Weight>::result_type result_type;
lazy_weighted_variance_impl(dont_care) {}
@@ -64,7 +64,7 @@ namespace impl
,\quad n\ge2,\quad\hat{\sigma}_0^2 = 0.
\f]
where \f$\bar{w}_n\f$ is the sum of the \f$n\f$ weights \f$w_i\f$ and \f$\hat{\mu}_n\f$
- the estimate of the mean of the weighted smaples. Note that the sample variance is not defined for
+ the estimate of the mean of the weighted samples. Note that the sample variance is not defined for
\f$n <= 1\f$.
*/
template<typename Sample, typename Weight, typename MeanFeature, typename Tag>
@@ -73,11 +73,11 @@ namespace impl
{
typedef typename numeric::functional::multiplies<Sample, Weight>::result_type weighted_sample;
// for boost::result_of
- typedef typename numeric::functional::average<weighted_sample, Weight>::result_type result_type;
+ typedef typename numeric::functional::fdiv<weighted_sample, Weight>::result_type result_type;
template<typename Args>
weighted_variance_impl(Args const &args)
- : weighted_variance(numeric::average(args[sample | Sample()], numeric::one<Weight>::value))
+ : weighted_variance(numeric::fdiv(args[sample | Sample()], numeric::one<Weight>::value))
{
}
@@ -93,8 +93,8 @@ namespace impl
result_type tmp = args[parameter::keyword<Tag>::get()] - some_mean(args);
this->weighted_variance =
- numeric::average(this->weighted_variance * (sum_of_weights(args) - args[weight]), sum_of_weights(args))
- + numeric::average(tmp * tmp * args[weight], sum_of_weights(args) - args[weight] );
+ numeric::fdiv(this->weighted_variance * (sum_of_weights(args) - args[weight]), sum_of_weights(args))
+ + numeric::fdiv(tmp * tmp * args[weight], sum_of_weights(args) - args[weight] );
}
}