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 |
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.
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.
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.