npstat::WeightedStatAccumulator Class Reference
Detailed DescriptionThis class calculates minimum value, maximum value, mean, and standard deviation of weighted observations. "mean" and "stdev" functions will cause a runtime exception to be thrown in case "accumulate" function was never called after the object was created (or after it was reset). It is assumed that the weights are known precisely and that the weights do not depend on the observations (this is important!). Weights can not be negative. This code updates a running average, so it should work better than a "naive" implementation. Member Function Documentation◆ accumulate() [1/3]
Add the sample from another accumulator ◆ accumulate() [2/3]
Accumulate a product of a WeightedStatAccumulator times double ◆ accumulate() [3/3]
Main data accumulating function ◆ averageWeight()
Average weight (fills with 0 weight are ignored) ◆ classId()
Method related to "geners" I/O ◆ count()
This method returns the effective number of counts which is (squared sum of weights)/(sum of squared weights) ◆ location()
Standard plotting accessor ◆ max()
Maximum value in the processed sample ◆ maxWeight()
Maximum weight among observations processed so far ◆ mean()
Accumulated sample average ◆ meanUncertainty()
Uncertainty of the population mean ◆ min()
Minimum value in the processed sample ◆ ncalls()
This method returns the total number of times the "accumulate(double, double)" method was called since the last reset (or since the object was created) ◆ nfills()
This method returns the number of times the "accumulate(double, double)" method was called with a positive weight ◆ noThrowMean()
Accumulated sample average. Will not throw an exception if no data is accumulated. Instead, the provided function argument will be returned. ◆ noThrowMeanUncertainty()
Uncertainty of the mean. Will not throw an exception if no data is accumulated. Instead, the provided function argument will be returned. ◆ noThrowStdev()
Standard deviation estimate. Will not throw an exception if no data is accumulated. Instead, the provided function argument will be returned. ◆ operator!=()
Logical negation of operator== ◆ operator*()
template<typename ConvToDouble >
Binary multiplication by a double ◆ operator*=()
template<typename ConvertibleToDouble >
The effect of "operator*=" is the same as if all values were multiplied by "r" for each "accumulate" call ◆ operator+()
Binary sum with another accumulator ◆ operator+=() [1/2]
template<typename Pair >
In this method, it is assumed that the first element of the pair is the value and the second is the weight ◆ operator+=() [2/2]
Add the summary from another accumulator ◆ operator/()
template<typename ConvToDouble >
Binary division by a double ◆ operator/=()
template<typename ConvertibleToDouble >
The effect of "operator/=" is the same as if all values were divided by "r" for each "accumulate" call ◆ operator==()
Comparison for equality ◆ reset()
Clear all accumulators ◆ scaleWeights()
Scaling of the weights. The effect is the same as if all weights were multiplied by "r" for each "accumulate" call. Note that r can not be negative for this method. ◆ stdev()
Estimate of the population standard deviation ◆ sumOfSquaredWeights()
Sum of squared weights accumulated so far ◆ sumOfWeights()
Sum of weights accumulated so far The documentation for this class was generated from the following file: Generated by 1.9.1 |