Class for collecting data and calculating simple statistics.
More...
#include <Statistics.hpp>
|
T | mean () const |
| Returns the mean of the values added. More...
|
|
T | angularMean () const |
| Returns the angular mean of the values added. More...
|
|
T | median () const |
| Returns the median of the values added. More...
|
|
T | variance () const |
| Returns the variance of the values added The variance is computed as \( \frac{1}{n-1} \Sigma_{d\in data}(m-\mu)^2 \) where \( \mu \) is the mean of the data.
|
|
T | angularVariance () const |
| Returns the angular variance of the values added The variance is computed as \( \frac{1}{n-1} \Sigma_{d\in data}\left[\cos^{-1}(\sin(d)\sin(\mu)-\cos(d)\cos(\mu))\right]^2 \) where \( \mu \) is the angular mean of the data.
|
|
std::pair< T, T > | meanAndVariance () const |
| returns the mean and the variance of the data. More...
|
|
std::pair< T, T > | angularMeanAndVariance () const |
| returns the angular mean and the variance of the data. More...
|
|
T | minValue () const |
| Returns the minimum value of data added. More...
|
|
T | maxValue () const |
| Returns the maximum value of data added. More...
|
|
std::pair< T, T > | minAndMaxValue () const |
| Returns pair containing the minimum and maximum value of the data added. More...
|
|
void | add (const T &t) |
| Add data to statistics.
|
|
void | clear () |
| Clear the recorded statistics data.
|
|
const std::list< T > & | data () const |
| Provides reference to the internal data container.
|
|
|
template<class V > |
static T | mean (const V &data) |
| Calculates the mean for a list of data.
|
|
template<class V > |
static T | angularMean (const V &data) |
| Calculates the mean for a list of angles.
|
|
template<class V > |
static T | median (const V &data) |
| Calcualtes the median for a list of data.
|
|
template<class V > |
static T | variance (const V &data, const T &mean) |
| Calculates the variance for a list of data. More...
|
|
template<class V > |
static T | angularVariance (const V &data, const T &mean) |
| Calculates the variance for a list of angles.
|
|
template<class V > |
static std::pair< T, T > | meanAndVariance (const V &data) |
|
template<class V > |
static std::pair< T, T > | angularMeanAndVariance (const V &data) |
|
template<class V > |
static T | minValue (const V &data) |
| Finds the minimal value in data.
|
|
template<class V > |
static T | maxValue (const V &data) |
| Finds the maximal value in data.
|
|
template<class V > |
static std::pair< T, T > | minAndMaxValue (const V &data) |
| Finds the minimal and maximal value in data.
|
|
template<class T>
class rw::math::Statistics< T >
Class for collecting data and calculating simple statistics.
◆ angularMean()
Returns the angular mean of the values added.
The angular mean is computed as \( \tan^{-1}\frac{\Sigma_{d\in data}\sin(d)}{\Sigma_{d\in data}\cos(d)} \)
◆ angularMeanAndVariance() [1/2]
std::pair<T, T> angularMeanAndVariance |
( |
| ) |
const |
|
inline |
◆ angularMeanAndVariance() [2/2]
static std::pair<T, T> angularMeanAndVariance |
( |
const V & |
data | ) |
|
|
inlinestatic |
Calculates the mean and variance of a list of angles.
◆ maxValue()
Returns the maximum value of data added.
If no data is added 0 is returned.
◆ mean()
Returns the mean of the values added.
The mean is computed as \( \frac{1}{n} \Sigma_{d\in data}d \)
◆ meanAndVariance() [1/2]
std::pair<T, T> meanAndVariance |
( |
| ) |
const |
|
inline |
◆ meanAndVariance() [2/2]
static std::pair<T, T> meanAndVariance |
( |
const V & |
data | ) |
|
|
inlinestatic |
Calculates the mean and variance of a list of data
◆ median()
Returns the median of the values added.
Given an equal number of element, the mean is calculated as the average of the two center elements.
◆ minAndMaxValue()
std::pair<T, T> minAndMaxValue |
( |
| ) |
const |
|
inline |
Returns pair containing the minimum and maximum value of the data added.
If no data is added 0 is returned for both values.
◆ minValue()
Returns the minimum value of data added.
If no data is added 0 is returned.
◆ variance()
static T variance |
( |
const V & |
data, |
|
|
const T & |
mean |
|
) |
| |
|
inlinestatic |
Calculates the variance for a list of data.
- Parameters
-
data | [in] data |
mean | [in] The mean value of the data |
- Returns
- variance of data
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Statistics< T > & |
statistics |
|
) |
| |
|
friend |
Statitics to stream.
- Parameters
-
os | [in/out] stream to use |
statistics | [in] Statistics to output |
- Returns
- the resulting stream
The documentation for this class was generated from the following files:
- core/math_fwd.hpp
- Statistics.hpp