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_p_square_quantile_impl< Sample, Weight, Impl > Struct Template Reference

Single quantile estimation with the $P^2$ algorithm for weighted samples. More...

#include <statistics_fwd.hpp>

Inheritance diagram for boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >:
Collaboration diagram for boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >:

Public Types

typedef
numeric::functional::multiplies
< Sample, Weight >
::result_type 
weighted_sample
 
typedef
numeric::functional::fdiv
< weighted_sample, std::size_t >
::result_type 
float_type
 
typedef array< float_type, 5 > array_type
 
typedef float_type result_type
 
typedef mpl::false_ is_droppable
 

Public Member Functions

template<typename Args >
 weighted_p_square_quantile_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 Impl>
struct boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >

Single quantile estimation with the $P^2$ algorithm for weighted samples.

This version of the $P^2$ algorithm extends the $P^2$ algorithm to support weighted samples. The $P^2$ algorithm estimates a quantile dynamically without storing samples. Instead of storing the whole sample cumulative distribution, only five points (markers) are stored. The heights of these markers are the minimum and the maximum of the samples and the current estimates of the $(p/2)$-, $p$ - and $(1+p)/2$ -quantiles. Their positions are equal to the number of samples that are smaller or equal to the markers. Each time a new sample is added, the positions of the markers are updated and if necessary their heights are adjusted using a piecewise- parabolic formula.

For further details, see

R. Jain and I. Chlamtac, The P^2 algorithm for dynamic calculation of quantiles and histograms without storing observations, Communications of the ACM, Volume 28 (October), Number 10, 1985, p. 1076-1085.

Parameters
quantile_probability

Member Typedef Documentation

template<typename Sample , typename Weight , typename Impl >
typedef array<float_type, 5> boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >::array_type
template<typename Sample , typename Weight , typename Impl >
typedef numeric::functional::fdiv<weighted_sample, std::size_t>::result_type boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >::float_type
template<typename Sample , typename Weight , typename Impl >
typedef float_type boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >::result_type
template<typename Sample , typename Weight , typename Impl >
typedef numeric::functional::multiplies<Sample, Weight>::result_type boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >::weighted_sample

Constructor & Destructor Documentation

template<typename Sample , typename Weight , typename Impl >
template<typename Args >
boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >::weighted_p_square_quantile_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 Impl >
result_type boost::accumulators::impl::weighted_p_square_quantile_impl< Sample, Weight, Impl >::result ( dont_care  ) const
inline

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