Plaquette
 
Loading...
Searching...
No Matches
pq::MovingStats Class Reference
Inheritance diagram for pq::MovingStats:
Collaboration diagram for pq::MovingStats:

Public Member Functions

 MovingStats ()
 Default constructor (infinite time window).
 
 MovingStats (float timeWindow)
 Default constructor (finite time window).
 
void infiniteTimeWindow ()
 Sets to "infinite" smoothing window.
 
void timeWindow (float seconds)
 Changes the smoothing window (expressed in seconds).
 
float timeWindow () const
 Returns the smoothing window (expressed in seconds).
 
bool timeWindowIsInfinite () const
 Returns true if time window is infinite.
 
virtual void reset ()
 Resets the statistics.
 
virtual float update (float value, float sampleRate=1)
 Adds a value to the statistics (returns the mean).
 
virtual float mean () const
 Returns an exponential moving average of the samples.
 
virtual float var () const
 Returns an exponential moving variance of the samples.
 
virtual float stdDev () const
 Returns the standard deviation of the samples.
 
virtual float normalize (float value) const
 Returns the normalized value according N(0, 1).
 
virtual float normalize (float value, float mean, float stdDev) const
 Returns the normalized value according to the computed statistics (mean and variance).
 
virtual bool isOutlier (float value, float nStdDev=1.5f) const
 Returns true if the value is considered an outlier.
 
virtual bool isLowOutlier (float value, float nStdDev=1.5f) const
 Returns true if the value is considered a low outlier (below average).
 
virtual bool isHighOutlier (float value, float nStdDev=1.5f) const
 Returns true if the value is considered a high outlier (above average).
 
virtual float stddev () const
 

Public Attributes

MovingAverage _avg
 
float _mean2
 

Member Function Documentation

◆ isHighOutlier()

bool pq::MovingStats::isHighOutlier ( float  value,
float  nStdDev = 1.5f 
) const
virtual

Returns true if the value is considered a high outlier (above average).

Parameters
valuethe raw value to be tested (non-normalized)
nStdDevthe number of standard deviations (typically between 1 and 3); low values = more sensitive
Returns
true if value is nStdDev number of standard deviations above mean

◆ isLowOutlier()

bool pq::MovingStats::isLowOutlier ( float  value,
float  nStdDev = 1.5f 
) const
virtual

Returns true if the value is considered a low outlier (below average).

Parameters
valuethe raw value to be tested (non-normalized)
nStdDevthe number of standard deviations (typically between 1 and 3); low values = more sensitive
Returns
true if value is nStdDev number of standard deviations below mean

◆ isOutlier()

bool pq::MovingStats::isOutlier ( float  value,
float  nStdDev = 1.5f 
) const
virtual

Returns true if the value is considered an outlier.

Parameters
valuethe raw value to be tested (non-normalized)
nStdDevthe number of standard deviations (typically between 1 and 3); low values = more sensitive
Returns
true if value is nStdDev number of standard deviations above or below mean

◆ reset()

void pq::MovingStats::reset ( )
virtual

Resets the statistics.

Reimplemented in pq::Normalizer.

◆ stddev()

virtual float pq::MovingStats::stddev ( ) const
inlinevirtual
Deprecated:
Returns the standard deviation of the samples.

◆ update()

float pq::MovingStats::update ( float  value,
float  sampleRate = 1 
)
virtual

Adds a value to the statistics (returns the mean).

Reimplemented in pq::Normalizer.


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