AntiMicroX
Public Member Functions | Private Attributes
StatisticsEstimator Class Reference

Estimates mean of a data stream using Welford's algorithm and calculates statistic properties. More...

#include <statisticsestimator.h>

Public Member Functions

 StatisticsEstimator ()
 
void reset ()
 Resets the StatisticsEstimator so that it is ready to process a new data stream. More...
 
void process (double x)
 Processes a new sample of the current data stream and updates internal intermediate values. More...
 
size_t getCount () const
 Gets the amount of processed samples. More...
 
double getMean () const
 Gets the mean of processed samples. More...
 
double calculateVariance () const
 Calculates the sample variance of the processed data stream from internal intermediate values. More...
 
double calculateRelativeErrorSq () const
 Calculates the squared relative three sigma error range, i.e. the squared estimation accuracy in percent, of the processed data stream from internal intermediate values. Use the squared value to avoid expensive root calculation. More...
 

Private Attributes

double m_mean
 
double m_var
 
size_t m_count
 

Detailed Description

Estimates mean of a data stream using Welford's algorithm and calculates statistic properties.

Constructor & Destructor Documentation

◆ StatisticsEstimator()

StatisticsEstimator::StatisticsEstimator ( )
Here is the call graph for this function:

Member Function Documentation

◆ calculateRelativeErrorSq()

double StatisticsEstimator::calculateRelativeErrorSq ( ) const

Calculates the squared relative three sigma error range, i.e. the squared estimation accuracy in percent, of the processed data stream from internal intermediate values. Use the squared value to avoid expensive root calculation.

Returns
Squared relative error range.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateVariance()

double StatisticsEstimator::calculateVariance ( ) const

Calculates the sample variance of the processed data stream from internal intermediate values.

Returns
Sample variance
Here is the caller graph for this function:

◆ getCount()

size_t StatisticsEstimator::getCount ( ) const
inline

Gets the amount of processed samples.

Returns
Processed sample count.
Here is the caller graph for this function:

◆ getMean()

double StatisticsEstimator::getMean ( ) const
inline

Gets the mean of processed samples.

Returns
Mean of processed samples.

◆ process()

void StatisticsEstimator::process ( double  x)

Processes a new sample of the current data stream and updates internal intermediate values.

Here is the caller graph for this function:

◆ reset()

void StatisticsEstimator::reset ( )

Resets the StatisticsEstimator so that it is ready to process a new data stream.

Here is the caller graph for this function:

Field Documentation

◆ m_count

size_t StatisticsEstimator::m_count
private

◆ m_mean

double StatisticsEstimator::m_mean
private

◆ m_var

double StatisticsEstimator::m_var
private

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