Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit b9ab49fc70.
PrevUpHomeNext

Struct template lazy_rolling_variance_impl

boost::accumulators::impl::lazy_rolling_variance_impl — Immediate (lazy) calculation of the rolling variance.

Synopsis

// In header: <boost/accumulators/statistics/rolling_variance.hpp>

template<typename Sample> 
struct lazy_rolling_variance_impl : public accumulator_base {
  // types
  typedef numeric::functional::fdiv< Sample, std::size_t, void, void >::result_type result_type;

  // construct/copy/destruct
  lazy_rolling_variance_impl(dont_care);

  // public member functions
  template<typename Args> result_type result(Args const &) const;
  template<typename Archive> void serialize(Archive &, const unsigned int);
};

Description

Calculation of sample variance is done as follows, see also http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance. For a rolling window of size , when , the variance is computed according to the formula

Equation 1.13. 


When , the sample variance over the window becomes:

Equation 1.14. 


lazy_rolling_variance_impl public construct/copy/destruct

  1. lazy_rolling_variance_impl(dont_care);

lazy_rolling_variance_impl public member functions

  1. template<typename Args> result_type result(Args const & args) const;
  2. template<typename Archive> 
      void serialize(Archive & ar, const unsigned int file_version);

PrevUpHomeNext