CFEL - ASG Software Suite  2.5.0
CASS
Public Types | Public Member Functions | Private Attributes | List of all members
cass::MovingStatisticsCalculator< Type > Class Template Reference

statistics calculator for a exponential moving statistics More...

#include <statistics_calculator.hpp>

Public Types

typedef Type value_type
 define the value type More...
 

Public Member Functions

 MovingStatisticsCalculator (unsigned int nAverages=200)
 constructor More...
 
void addDatum (const value_type &datum)
 add a datum to the distribution More...
 
value_type mean () const
 retrieve the mean of the distribution More...
 
value_type variance () const
 retrieve the variance of the distribution More...
 
value_type stdv () const
 retrieve the standart deviation of the distribution More...
 
void reset ()
 reset the statistics More...
 
void nbrAverages (unsigned int nAverages)
 set the nbr of averages More...
 

Private Attributes

value_type _mean
 the current mean value More...
 
value_type _stdv
 the stdv value More...
 
value_type _alpha
 how much should the current datum be weighted More...
 
bool _firstdatum
 flag to see whether first datum is added More...
 

Detailed Description

template<typename Type>
class cass::MovingStatisticsCalculator< Type >

statistics calculator for a exponential moving statistics

The algorithms used by this class are based on a discussion found here: jttp://mathforum.org/kb/message.jspa?messageID=1637905

Template Parameters
typeof the values for the average, defines the precision
Author
Lutz Foucar

Definition at line 373 of file statistics_calculator.hpp.

Member Typedef Documentation

template<typename Type >
typedef Type cass::MovingStatisticsCalculator< Type >::value_type

define the value type

Definition at line 377 of file statistics_calculator.hpp.

Constructor & Destructor Documentation

template<typename Type >
cass::MovingStatisticsCalculator< Type >::MovingStatisticsCalculator ( unsigned int  nAverages = 200)
inline

constructor

Parameters
nAveragesthe last how many datums should have highest contribution to this.

Definition at line 384 of file statistics_calculator.hpp.

References cass::CummulativeStatisticsNoOutlier< Type >::reset().

Member Function Documentation

template<typename Type >
void cass::MovingStatisticsCalculator< Type >::addDatum ( const value_type datum)
inline

add a datum to the distribution

Parameters
datumThe datum to be added

Definition at line 394 of file statistics_calculator.hpp.

References cass::CummulativeStatisticsNoOutlier< Type >::_mean, cass::CummulativeStatisticsNoOutlier< Type >::_stdv, and cass::CummulativeStatisticsNoOutlier< Type >::mean().

template<typename Type >
value_type cass::MovingStatisticsCalculator< Type >::mean ( ) const
inline

retrieve the mean of the distribution

Returns
mean of the distribution

Definition at line 404 of file statistics_calculator.hpp.

References cass::CummulativeStatisticsNoOutlier< Type >::_mean.

template<typename Type >
void cass::MovingStatisticsCalculator< Type >::nbrAverages ( unsigned int  nAverages)
inline

set the nbr of averages

convert the nbr of averages to the alpha for the statistic calculation

Parameters
nAveragesthe last how many datums should have highest contribution to this.

Definition at line 441 of file statistics_calculator.hpp.

template<typename Type >
void cass::MovingStatisticsCalculator< Type >::reset ( )
inline
template<typename Type >
value_type cass::MovingStatisticsCalculator< Type >::stdv ( ) const
inline

retrieve the standart deviation of the distribution

Returns
standart deviation of the distribution

Definition at line 422 of file statistics_calculator.hpp.

References cass::CummulativeStatisticsNoOutlier< Type >::stdv().

template<typename Type >
value_type cass::MovingStatisticsCalculator< Type >::variance ( ) const
inline

retrieve the variance of the distribution

Returns
variance of the distribution

Definition at line 413 of file statistics_calculator.hpp.

References cass::CummulativeStatisticsNoOutlier< Type >::_stdv.

Member Data Documentation

template<typename Type >
value_type cass::MovingStatisticsCalculator< Type >::_alpha
private

how much should the current datum be weighted

Definition at line 454 of file statistics_calculator.hpp.

template<typename Type >
bool cass::MovingStatisticsCalculator< Type >::_firstdatum
private

flag to see whether first datum is added

Definition at line 457 of file statistics_calculator.hpp.

template<typename Type >
value_type cass::MovingStatisticsCalculator< Type >::_mean
private

the current mean value

Definition at line 448 of file statistics_calculator.hpp.

template<typename Type >
value_type cass::MovingStatisticsCalculator< Type >::_stdv
private

the stdv value

Definition at line 451 of file statistics_calculator.hpp.


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