50int64_t
postmod(int64_t a, int64_t m);
64double mean_average(
const std::vector<double> &values,
int lo,
int hi);
130 [[nodiscard]]
double sigma()
const {
160double welford_stddev(
const std::vector<double> &values);
std::vector< Sample > Series
Definition: fx_sample.h:36
double mean_average(const Series &series, int lo, int hi)
Compute the arithmetic mean of a subsequence of samples.
Definition: fx_stats_util.cc:52
int64_t postmod(int64_t a, int64_t m)
Compute a modulo with a non-negative result ("positive modulo").
Definition: fx_stats_util.cc:63
Maintains running statistics for a stream of values using Welford's online algorithm.
Definition: fx_stats_util.h:100
uint64_t count
Number of values processed so far.
Definition: fx_stats_util.h:101
double mean
Current mean of the values.
Definition: fx_stats_util.h:102
bool ready() const
Checks if the statistics are ready (i.e., more than one value has been processed).
Definition: fx_stats_util.h:124
double sigma() const
Returns the sample standard deviation of the values.
Definition: fx_stats_util.h:130
double m2
Sum of squared deviations from the mean.
Definition: fx_stats_util.h:103
void add(double x)
Adds a new value to the statistics.
Definition: fx_stats_util.h:112
void clear()
Resets the statistics to their initial state.
Definition: fx_stats_util.h:137