dip::StatisticsAccumulator class

StatisticsAccumulator computes population statistics by accumulating the first four central moments.

Contents

Samples are added one by one, using the Push method. Other members are used to retrieve estimates of the population statistics based on the samples seen up to that point. Formula used to compute population statistics are corrected, though the standard deviation, skewness and excess kurtosis are not unbiased estimators. The accumulator uses a stable algorithm to prevent catastrophic cancellation.

It is possible to accumulate samples in different objects (e.g. when processing with multiple threads), and add the accumulators together using the + operator.

Functions

auto ExcessKurtosis() const -> dip::dfloat
Estimator of population excess kurtosis. This estimator is only unbiased for normally distributed data (it is not possible to derive an unbiased estimator).
auto Mean() const -> dip::dfloat
Unbiased estimator of population mean
auto Number() const -> dip::uint
Number of samples
void Push(dip::dfloat x)
Add a sample to the accumulator
void Reset()
Reset the accumulator, leaving it as if newly allocated.
auto Skewness() const -> dip::dfloat
Estimator of population skewness. This estimator is unbiased only for symmetric distributions (it is not possible to derive an unbiased estimator).
auto StandardDeviation() const -> dip::dfloat
Estimator of population standard deviation (it is not possible to derive an unbiased estimator)
auto Variance() const -> dip::dfloat
Unbiased estimator of population variance

Operators

auto operator+=(dip::StatisticsAccumulator const& b) -> dip::StatisticsAccumulator&
Combine two accumulators

Function documentation

void Reset( )

Reset the accumulator, leaving it as if newly allocated.

void Push( dip::dfloat x)

Add a sample to the accumulator

dip::uint Number( ) const

Number of samples

dip::dfloat Mean( ) const

Unbiased estimator of population mean

dip::dfloat Variance( ) const

Unbiased estimator of population variance

dip::dfloat StandardDeviation( ) const

Estimator of population standard deviation (it is not possible to derive an unbiased estimator)

dip::dfloat Skewness( ) const

Estimator of population skewness. This estimator is unbiased only for symmetric distributions (it is not possible to derive an unbiased estimator).

dip::dfloat ExcessKurtosis( ) const

Estimator of population excess kurtosis. This estimator is only unbiased for normally distributed data (it is not possible to derive an unbiased estimator).