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::lazy_rolling_variance_impl< Sample > Struct Template Reference

Immediate (lazy) calculation of the rolling variance. More...

#include <rolling_variance.hpp>

Inheritance diagram for boost::accumulators::impl::lazy_rolling_variance_impl< Sample >:
Collaboration diagram for boost::accumulators::impl::lazy_rolling_variance_impl< Sample >:

Public Types

typedef
numeric::functional::fdiv
< Sample, std::size_t, void,
void >::result_type 
result_type
 
typedef mpl::false_ is_droppable
 

Public Member Functions

 lazy_rolling_variance_impl (dont_care)
 
template<typename Args >
result_type result (Args const &args) 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>
struct boost::accumulators::impl::lazy_rolling_variance_impl< Sample >

Immediate (lazy) calculation of the rolling variance.

Calculation of sample variance $\sigma_n^2$ is done as follows, see also http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance. For a rolling window of size $N$, when $n <= N$, the variance is computed according to the formula

\[ \sigma_n^2 = \frac{1}{n-1} \sum_{i = 1}^n (x_i - \mu_n)^2. \]

When $n > N$, the sample variance over the window becomes:

\[ \sigma_n^2 = \frac{1}{N-1} \sum_{i = n-N+1}^n (x_i - \mu_n)^2. \]

Member Typedef Documentation

template<typename Sample >
typedef numeric::functional::fdiv<Sample, std::size_t,void,void>::result_type boost::accumulators::impl::lazy_rolling_variance_impl< Sample >::result_type

Constructor & Destructor Documentation

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

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