STRUCT T(3)

NAME
boost::accumulators::impl::weighted_covariance_impl - Weighted Covariance Estimator.

SYNOPSIS

// In header: <boost/accumulators/statistics/weighted_covariance.hpp>
template<typename Sample, typename Weight, typename VariateType,
         typename VariateTag>
struct weighted_covariance_impl {
  // types
  typedef numeric::functional::multiplies< Weight, typename numeric::functional::average< Sample, std::size_t >::result_type >::result_type      weighted_sample_type;
  typedef numeric::functional::multiplies< Weight, typename numeric::functional::average< 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;
  // construct/copy/destruct
  template<typename Args> weighted_covariance_impl(Args const &);
  // public member functions
  template<typename Args> void operator()(Args const &);
  result_type result(dont_care) const;
};

DESCRIPTION

An iterative Monte Carlo estimator for the weighted covariance [1][IMAGE][2] [$thrm{Cov}(X,X')$], where [3][IMAGE][4] [$X$] is a sample and [5][IMAGE][6] [$X'$] a variate, is given by:

Equation 1.27.  [7].sp .RS 4 [IMAGE][8] \[ \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, \] .RE

[9][IMAGE][10] [$ and [11][IMAGE][12] [$ being the weighted means of the samples and variates and [13][IMAGE][14] [$ the sum of the [15][IMAGE][16] [$n$] first weights [17][IMAGE][18] [$w_i$].

  weighted_covariance_impl public construct/copy/destruct

    1.

    template<typename Args> weighted_covariance_impl(Args const & args);

  weighted_covariance_impl public member functions

    1.

    template<typename Args> void operator()(Args const & args);

    2.

    result_type result(dont_care) const;