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, 1 >.
|
| | Stats () |
| |
| 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 |
| |
| double | avg () const |
| | Return the arithmetic mean, i.e. average, value. More...
|
| |
| double | mean () const |
| |
| double | var () const |
| | Return the population variance. More...
|
| |
| double | variance () const |
| |
| double | std () const |
| | Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
|
| |
| double | stdDev () const |
| |
template<typename ValueT>
class nanovdb::Stats< ValueT, 1 >
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()
◆ add() [1/3]
Add the samples from the other Stats instance.
◆ add() [2/3]
| Stats& add |
( |
const ValueT & |
val | ) |
|
|
inline |
◆ add() [3/3]
| Stats& add |
( |
const ValueT & |
val, |
|
|
uint64_t |
n |
|
) |
| |
|
inline |
Add n samples with constant value val.
◆ avg()
Return the arithmetic mean, i.e. average, value.
◆ hasAverage()
| static constexpr bool hasAverage |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ hasMinMax()
| static constexpr bool hasMinMax |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ hasStdDeviation()
| static constexpr bool hasStdDeviation |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ mean()
◆ size()
◆ std()
Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.
◆ stdDev()
◆ var()
Return the population variance.
- Note
- The unbiased sample variance = population variance * num/(num-1)
◆ variance()
| double variance |
( |
| ) |
const |
|
inline |
◆ mAux
◆ mAvg
◆ mSize