Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag > Struct Template Reference

Iterative calculation of variance of weighted samples. More...

#include <statistics_fwd.hpp>

Inheritance diagram for boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >:
Collaboration diagram for boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >:

Public Types

typedef
numeric::functional::multiplies
< Sample, Weight >
::result_type 
weighted_sample
 
typedef
numeric::functional::fdiv
< weighted_sample, Weight >
::result_type 
result_type
 
typedef mpl::false_ is_droppable
 

Public Member Functions

template<typename Args >
 weighted_variance_impl (Args const &args)
 
template<typename Args >
void operator() (Args const &args)
 
result_type result (dont_care) const
 
detail::void_ operator() (dont_care)
 
detail::void_ add_ref (dont_care)
 
detail::void_ drop (dont_care)
 
detail::void_ on_drop (dont_care)
 

Detailed Description

template<typename Sample, typename Weight, typename MeanFeature, typename Tag>
struct boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >

Iterative calculation of variance of weighted samples.

Iterative calculation of variance of weighted samples:

\[ \hat{\sigma}_n^2 = \frac{\bar{w}_n - w_n}{\bar{w}_n}\hat{\sigma}_{n - 1}^2 + \frac{w_n}{\bar{w}_n - w_n}\left(X_n - \hat{\mu}_n\right)^2 ,\quad n\ge2,\quad\hat{\sigma}_0^2 = 0. \]

where $\bar{w}_n$ is the sum of the $n$ weights $w_i$ and $\hat{\mu}_n$ the estimate of the mean of the weighted samples. Note that the sample variance is not defined for $n <= 1$.

Member Typedef Documentation

template<typename Sample , typename Weight , typename MeanFeature , typename Tag >
typedef numeric::functional::fdiv<weighted_sample, Weight>::result_type boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >::result_type
template<typename Sample , typename Weight , typename MeanFeature , typename Tag >
typedef numeric::functional::multiplies<Sample, Weight>::result_type boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >::weighted_sample

Constructor & Destructor Documentation

template<typename Sample , typename Weight , typename MeanFeature , typename Tag >
template<typename Args >
boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >::weighted_variance_impl ( Args const &  args)
inline

Member Function Documentation

detail::void_ boost::accumulators::accumulator_base::add_ref ( dont_care  )
inlineinherited
detail::void_ boost::accumulators::accumulator_base::drop ( dont_care  )
inlineinherited
detail::void_ boost::accumulators::accumulator_base::on_drop ( dont_care  )
inlineinherited
detail::void_ boost::accumulators::accumulator_base::operator() ( dont_care  )
inlineinherited
template<typename Sample , typename Weight , typename MeanFeature , typename Tag >
template<typename Args >
void boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >::operator() ( Args const &  args)
inline
template<typename Sample , typename Weight , typename MeanFeature , typename Tag >
result_type boost::accumulators::impl::weighted_variance_impl< Sample, Weight, MeanFeature, Tag >::result ( dont_care  ) const
inline

The documentation for this struct was generated from the following file: