This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values.
More...
#include <nanovdb/util/GridStats.h>
Inherits Extrema< ValueT, 0 >.
|
| Stats () |
|
| Stats (const ValueT &val) |
|
Stats & | add (const ValueT &val) |
| Add a single sample. More...
|
|
Stats & | add (const ValueT &val, uint64_t n) |
| Add n samples with constant value val. More...
|
|
Stats & | add (const Stats &other) |
| Add the samples from the other Stats instance. More...
|
|
size_t | size () const |
|
Extrema & | min (const ValueT &v) |
|
const ValueT & | min () const |
|
Extrema & | max (const ValueT &v) |
|
const ValueT & | max () const |
|
Extrema & | add (const Extrema &other) |
|
| operator bool () const |
|
|
double | avg () const |
| Return the arithmetic mean, i.e. average, value. More...
|
|
double | mean () const |
| Return the arithmetic mean, i.e. average, value. More...
|
|
|
double | var () const |
| Return the population variance. More...
|
|
double | variance () const |
| Return the population variance. More...
|
|
|
double | std () const |
| Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
|
|
double | stdDev () const |
| Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
|
|
template<typename ValueT>
class nanovdb::Stats< ValueT, 0 >
This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values.
variance = Mean[ (X-Mean[X])^2 ] = Mean[X^2] - Mean[X]^2, standard deviation = sqrt(variance)
- Note
- This class employs incremental computation and double precision.
◆ BaseT
◆ RealT
◆ ValueType
◆ Stats() [1/2]
◆ Stats() [2/2]
Stats |
( |
const ValueT & |
val | ) |
|
|
inline |
◆ add() [1/4]
◆ add() [2/4]
Stats& add |
( |
const ValueT & |
val | ) |
|
|
inline |
◆ add() [3/4]
Stats& add |
( |
const ValueT & |
val, |
|
|
uint64_t |
n |
|
) |
| |
|
inline |
Add n samples with constant value val.
◆ add() [4/4]
Add the samples from the other Stats instance.
◆ avg()
Return the arithmetic mean, i.e. average, value.
◆ hasAverage()
static constexpr bool hasAverage |
( |
| ) |
|
|
inlinestatic |
◆ hasMinMax()
static constexpr bool hasMinMax |
( |
| ) |
|
|
inlinestatic |
◆ hasStdDeviation()
static constexpr bool hasStdDeviation |
( |
| ) |
|
|
inlinestatic |
◆ max() [1/2]
◆ max() [2/2]
const ValueT& max |
( |
| ) |
const |
|
inlineinherited |
◆ mean()
Return the arithmetic mean, i.e. average, value.
◆ min() [1/2]
◆ min() [2/2]
const ValueT& min |
( |
| ) |
const |
|
inlineinherited |
◆ operator bool()
◆ size() [1/2]
static constexpr size_t size |
( |
| ) |
|
|
inlinestaticinherited |
◆ size() [2/2]
◆ std()
Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.
◆ stdDev()
Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.
◆ var()
Return the population variance.
- Note
- The unbiased sample variance = population variance * num/(num-1)
◆ variance()
double variance |
( |
| ) |
const |
|
inline |
Return the population variance.
- Note
- The unbiased sample variance = population variance * num/(num-1)
◆ mAux
◆ mAvg
◆ mMax
◆ mMin
◆ mSize