Template Class CumulativeStatistics< T, typename ecl::enable_if< ecl::is_float< T > >::type >

Class Documentation

template<typename T>
class CumulativeStatistics<T, typename ecl::enable_if<ecl::is_float<T>>::type>

Calculate cumulative mean and variance (i.e. without storage).

Public Functions

inline CumulativeStatistics()
inline void clear()
inline void push_back(const T &x)

Catch the new data and update the cumulative calculations.

TODO it uses a float as a counter to increase the longevity of the cumulative calculation, however it really ought to handle the number_of_data rolling over problem.

Parameters

x – : new data

inline T size() const

Number of data used for statistics

Returns

T

inline T mean() const

Current cumulative calculation of mean.

Returns

T or 0.0 if there is not yet data.

inline T variance() const

Current cumulative calculation of variance.

Returns

T or 0.0 if there is not yet data.