177 static T
multiply(
const T& val1,
const T& val2);
184 static T
sqrt(
const T& val);
204 #include "impl/running_stats.hpp" T getVariance() const
Get the variance of stored samples.
void addSample(T x)
Add a new sample to the statistics.
RunningStats< T > operator-(const RunningStats< T > &other) const
Subtract the sequence represented by other from the sequence represented by this and return the updat...
T getMean() const
Get the mean of stored samples.
RunningStats< T > & operator-=(const RunningStats< T > &other)
Subtract the sequence represented by other from the sequence represented by this and update the stats...
void reset()
Reset the statistics to represent an empty sequence.
static T multiplyScalar(const T &val, double scalar)
val * scalar
T getSampleVariance() const
Get the sample variance of stored samples (like variance, but divided by count-1 instead of count...
Computation of running average and variance using Welford's algorithm.
size_t count
Number of represented samples.
static T sqrt(const T &val)
Return the square root of the given value (whatever meaning that might have).
T getStandardDeviation() const
Get standard deviation of stored samples.
size_t getCount() const
Get the number of stored samples.
void removeSample(T x)
Remove a sample from the statistics.
RunningStats< T > operator+(const RunningStats< T > &other) const
Combine the two sequences represented by this and other and represent their joint stats...
static T zero()
Return a T value representing zero.
static T multiply(const T &val1, const T &val2)
val1 * val2
T var
Sk term of the computation such that var(X0...Xk) = this->var/this->count.
T mean
Mean of represented samples.
RunningStats< T > & operator+=(const RunningStats< T > &other)
Combine the two sequences represented by this and other and represent their joint stats...