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_covariance_impl< Sample, Weight, VariateType, VariateTag > Struct Template Reference

Weighted Covariance Estimator. More...

#include <statistics_fwd.hpp>

Inheritance diagram for boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >:
Collaboration diagram for boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >:

Public Types

typedef
numeric::functional::multiplies
< Weight, typename
numeric::functional::fdiv
< Sample, std::size_t >
::result_type >::result_type 
weighted_sample_type
 
typedef
numeric::functional::multiplies
< Weight, typename
numeric::functional::fdiv
< VariateType, std::size_t >
::result_type >::result_type 
weighted_variate_type
 
typedef
numeric::functional::outer_product
< weighted_sample_type,
weighted_variate_type >
::result_type 
result_type
 
typedef mpl::false_ is_droppable
 

Public Member Functions

template<typename Args >
 weighted_covariance_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 VariateType, typename VariateTag>
struct boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >

Weighted Covariance Estimator.

An iterative Monte Carlo estimator for the weighted covariance $\mathrm{Cov}(X,X')$, where $X$ is a sample and $X'$ a variate, is given by:

\[ \hat{c}_n = \frac{\bar{w}_n-w_n}{\bar{w}_n} \hat{c}_{n-1} + \frac{w_n}{\bar{w}_n-w_n}(X_n - \hat{\mu}_n)(X_n' - \hat{\mu}_n'), \quad n\ge2,\quad\hat{c}_1 = 0, \]

$\hat{\mu}_n$ and $\hat{\mu}_n'$ being the weighted means of the samples and variates and $\bar{w}_n$ the sum of the $n$ first weights $w_i$.

Member Typedef Documentation

template<typename Sample , typename Weight , typename VariateType , typename VariateTag >
typedef numeric::functional::outer_product<weighted_sample_type, weighted_variate_type>::result_type boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >::result_type
template<typename Sample , typename Weight , typename VariateType , typename VariateTag >
typedef numeric::functional::multiplies<Weight, typename numeric::functional::fdiv<Sample, std::size_t>::result_type>::result_type boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >::weighted_sample_type
template<typename Sample , typename Weight , typename VariateType , typename VariateTag >
typedef numeric::functional::multiplies<Weight, typename numeric::functional::fdiv<VariateType, std::size_t>::result_type>::result_type boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >::weighted_variate_type

Constructor & Destructor Documentation

template<typename Sample , typename Weight , typename VariateType , typename VariateTag >
template<typename Args >
boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >::weighted_covariance_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 VariateType , typename VariateTag >
template<typename Args >
void boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >::operator() ( Args const &  args)
inline
template<typename Sample , typename Weight , typename VariateType , typename VariateTag >
result_type boost::accumulators::impl::weighted_covariance_impl< Sample, Weight, VariateType, VariateTag >::result ( dont_care  ) const
inline

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