PIP 6.1.0
Platform-Independent Primitives
Loading...
Searching...
No Matches
PIStatistic< T > Class Template Reference

Template class for calculating statistical measures of a data set Calculates mean, variance, skewness and kurtosis for a numeric sample. More...

#include <pistatistic.h>

Public Member Functions

 PIStatistic ()
 Constructs an object with all accumulated values set to zero.
bool calculate (const PIVector< T > &val, const T &given_mean)
 Calculates all statistics using the supplied mean value.
bool calculate (const PIVector< T > &val)
 Calculates all statistics and derives the mean from the sample.

Static Public Member Functions

static T calculateMean (const PIVector< T > &val)
 Returns arithmetic mean of the sample, or zero for an empty vector.

Public Attributes

T mean
 Sample mean.
T variance
 Variance estimate accumulated for the sample.
T skewness
 Sample skewness.
T kurtosis
 Excess kurtosis of the sample.

Detailed Description

template<typename T>
class PIStatistic< T >

Template class for calculating statistical measures of a data set Calculates mean, variance, skewness and kurtosis for a numeric sample.

Member Function Documentation

◆ calculate()

template<typename T>
bool PIStatistic< T >::calculate ( const PIVector< T > & val,
const T & given_mean )
inline

Calculates all statistics using the supplied mean value.

Returns false when the sample contains fewer than two values.