shark::Statistics Struct Reference

Calculate pre-defined statistics given a range of values. More...

#include <shark/Statistics/Statistics.h>

+ Collaboration diagram for shark::Statistics:

Classes

struct  Histogram
 Tags the histogram. More...
 
struct  LowerQuartile
 Tags the lower quartile. More...
 
struct  Max
 Tags the maximum value. More...
 
struct  Mean
 Tags the mean value. More...
 
struct  Median
 Tags the median. More...
 
struct  Min
 Tags the minimum value. More...
 
struct  NumSamples
 Tags the number of samples. More...
 
struct  UnbiasedVariance
 Tags the unbiased variance (not implemented). More...
 
struct  UpperQuartile
 Tags the upper quartile. More...
 
struct  Variance
 Tags the variance. More...
 

Public Member Functions

 Statistics (double lowerQuantileProbability=0.25, double upperQuantileProbability=0.75)
 Default c'tor. More...
 
double operator() (Mean mean) const
 Accesses the mean value of the supplied values. More...
 
double operator() (Variance variance) const
 Accesses the variance of the supplied values. More...
 
histogram_type operator() (Histogram histogram) const
 Accesses the histogram of the supplied values. More...
 
double operator() (Median median) const
 Accesses the median of the supplied values. More...
 
double operator() (LowerQuartile lq) const
 Accesses the lower quartile of the supplied values. More...
 
double operator() (UpperQuartile uq) const
 Accesses the upper quartile of the supplied values. More...
 
double operator() (Min min) const
 Accesses the minimum of the supplied values. More...
 
double operator() (Max max) const
 Accesses the maximum of the supplied values. More...
 
std::size_t operator() (NumSamples numSamples) const
 Accesses the total number of samples. More...
 
void operator() (double d)
 Updates statistics with the supplied value. More...
 
template<class InputIterator >
void operator() (InputIterator begin, InputIterator end)
 Calculates statistics for the supplied range of values. More...
 

Detailed Description

Calculate pre-defined statistics given a range of values.

See Also
examples/Statistics/StatisticsMain.cpp

Calculate statistics from standard in:

stats = std::for_each( std::istream_iterator<double>( std::cin ), std::istream_iterator<double>(), stats );
std::cout << stats << std::endl;

Implemented in terms of boost::accumulators.

Definition at line 73 of file Statistics.h.

Constructor & Destructor Documentation

shark::Statistics::Statistics ( double  lowerQuantileProbability = 0.25,
double  upperQuantileProbability = 0.75 
)
inline

Default c'tor.

Parameters
[in]lowerQuantileProbabilityProbability for the lower quantile, default value: 0.25.
[in]upperQuantileProbabilityProbability for the upper quantile, default value: 0.75.

Definition at line 147 of file Statistics.h.

Member Function Documentation

double shark::Statistics::operator() ( Mean  mean) const
inline

Accesses the mean value of the supplied values.

Definition at line 155 of file Statistics.h.

References shark::mean().

double shark::Statistics::operator() ( Variance  variance) const
inline

Accesses the variance of the supplied values.

Definition at line 160 of file Statistics.h.

References shark::variance().

histogram_type shark::Statistics::operator() ( Histogram  histogram) const
inline

Accesses the histogram of the supplied values.

Definition at line 165 of file Statistics.h.

double shark::Statistics::operator() ( Median  median) const
inline

Accesses the median of the supplied values.

Definition at line 169 of file Statistics.h.

double shark::Statistics::operator() ( LowerQuartile  lq) const
inline

Accesses the lower quartile of the supplied values.

Definition at line 174 of file Statistics.h.

double shark::Statistics::operator() ( UpperQuartile  uq) const
inline

Accesses the upper quartile of the supplied values.

Definition at line 179 of file Statistics.h.

double shark::Statistics::operator() ( Min  min) const
inline

Accesses the minimum of the supplied values.

Definition at line 184 of file Statistics.h.

References shark::blas::min().

double shark::Statistics::operator() ( Max  max) const
inline

Accesses the maximum of the supplied values.

Definition at line 189 of file Statistics.h.

References shark::blas::max().

std::size_t shark::Statistics::operator() ( NumSamples  numSamples) const
inline

Accesses the total number of samples.

Definition at line 194 of file Statistics.h.

void shark::Statistics::operator() ( double  d)
inline

Updates statistics with the supplied value.

Parameters
[in]dThe value.

Definition at line 200 of file Statistics.h.

template<class InputIterator >
void shark::Statistics::operator() ( InputIterator  begin,
InputIterator  end 
)
inline

Calculates statistics for the supplied range of values.

Template Parameters
InputIteratorIterator type, needs to be a model of forward iterator.
Parameters
[in]beginIterator pointing to the first valid element of the range.
[in]endIterator pointing behind the last valid element of the range.

Definition at line 213 of file Statistics.h.


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