Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Statistics::RunningStatistic Class Reference

Keeps track of the running statistics of a given value. More...

#include <RunningStatistic.h>

Inherited by AZ::Statistics::NamedRunningStatistic.

Public Member Functions

void Reset ()
 
void PushSample (double value)
 
AZ::u64 GetNumSamples () const
 
double GetMostRecentSample () const
 
double GetMinimum () const
 
double GetMaximum () const
 
double GetAverage () const
 
double GetSum () const
 
double GetVariance (VarianceType varianceType=VarianceType::S) const
 
double GetStdev (VarianceType varianceType=VarianceType::S) const
 

Detailed Description

Keeps track of the running statistics of a given value.

Efficiently keeps track of min, max, average, variance and stdev without storing the value's history. Based on 1962 paper by B. P. Welford. https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance The algorithm here is the Two-pass algorithm which is numerically stable.

Member Function Documentation

◆ GetStdev()

double AZ::Statistics::RunningStatistic::GetStdev ( VarianceType  varianceType = VarianceType::S) const

See declaration of enum class VarianceType above on why we choose the S type by default.

◆ GetVariance()

double AZ::Statistics::RunningStatistic::GetVariance ( VarianceType  varianceType = VarianceType::S) const

See declaration of enum class VarianceType above on why we choose the S type by default.


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