yat  0.14.5pre
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
theplu::yat::statistics::Averager4 Class Reference

class to calculate 1st, 2nd, 3rd, and 4th central moments More...

#include <yat/statistics/Averager4.h>

Inheritance diagram for theplu::yat::statistics::Averager4:
theplu::yat::statistics::averager_base4< Averager4 > theplu::yat::statistics::averager_base3< Averager4 > theplu::yat::statistics::averager_base2< Averager4 > theplu::yat::statistics::averager_base< Averager4 >

Public Member Functions

 Averager4 (void)
 construct empty object
 
template<class Derived >
const Averager4operator+= (const averager_base4< Derived > &rhs)
 Third central moment. More...
 
double central_moment4 (void) const
 Fourth central moment. More...
 
double kurtosis (void) const
 Kurtosis. More...
 
double sum_x4_centered (void) const
 sum quadrupled centered More...
 
double central_moment3 (void) const
 Third central moment. More...
 
double skewness (void) const
 Skewness. More...
 
double sum_x3_centered (void) const
 
double cv (void) const
 Coeffient of variation. More...
 
double standard_error (void) const
 
double std (void) const
 The standard deviation is defined as the square root of the variance. More...
 
double std (double m) const
 The standard deviation is defined as the square root of the variance. More...
 
double sum_xx (void) const
 
double sum_xx_centered (void) const
 
double variance (double m) const
 The variance with known mean. More...
 
double variance (void) const
 The estimated variance. More...
 
double variance_unbiased (void) const
 
void add (double x, long n=1)
 add a data point More...
 
double mean (void) const
 mean More...
 
long n (void) const
 number of data points More...
 
void rescale (double a)
 Rescales the object. More...
 
void reset (void)
 Reset object. More...
 
double sum_x (void) const
 

Protected Member Functions

void add4 (double mean, double cm2, double cm3, double cm4, long int n)
 
void add4 (double delta)
 
double rescale4 (double x)
 
void add3 (double mean, double cm2, double cm3, long int n)
 
void add3 (double delta)
 
double rescale3 (double x)
 
void add2 (double mean, double cm2, long int n)
 
void add2 (double delta)
 
double rescale2 (double x)
 
void add1 (double x, long int n)
 
void add1 (double delta)
 
double rescale1 (double x)
 

Protected Attributes

double cm4_
 sum quadrupled centered
 
double cm3_
 
double cm2_
 
long int n_
 
double mean_
 mean
 

Friends

class averager_base< Averager4 >
 

Detailed Description

class to calculate 1st, 2nd, 3rd, and 4th central moments

Since
yat 0.9

Member Function Documentation

void theplu::yat::statistics::averager_base< Averager4 >::add ( double  x,
long  n = 1 
)
inlineinherited

add a data point

Adding n number of data point(s) with value x.

void theplu::yat::statistics::averager_base< Averager4 >::add1 ( double  x,
long int  n 
)
protectedinherited

add n data points with value x

void theplu::yat::statistics::averager_base< Averager4 >::add1 ( double  delta)
protectedinherited

add one data point with value delta + mean()

void theplu::yat::statistics::averager_base2< Averager4 >::add2 ( double  mean,
double  cm2,
long int  n 
)
protectedinherited

add a set of n data points with mean mean and centralized squaed sum cm

void theplu::yat::statistics::averager_base2< Averager4 >::add2 ( double  delta)
protectedinherited

add one data point with value delta + mean()

void theplu::yat::statistics::averager_base3< Averager4 >::add3 ( double  mean,
double  cm2,
double  cm3,
long int  n 
)
protectedinherited

add a set of n data points with mean mean, sum squared centered cm2, and sum cubed centered cm3.

void theplu::yat::statistics::averager_base3< Averager4 >::add3 ( double  delta)
protectedinherited

add one data point with value delta + mean()

void theplu::yat::statistics::averager_base4< Averager4 >::add4 ( double  mean,
double  cm2,
double  cm3,
double  cm4,
long int  n 
)
protectedinherited

add a set of n data points with mean mean, sum squared centered cm2, sum cubed centered cm3, and sum quadrupled centered cm4.

void theplu::yat::statistics::averager_base4< Averager4 >::add4 ( double  delta)
protectedinherited

add one data point with value delta + mean()

double theplu::yat::statistics::averager_base3< Averager4 >::central_moment3 ( void  ) const
inlineinherited

Third central moment.

Third central moment is calculated as $ \frac{1}{n} \sum (x_i-m)^3 $ where m is the mean.

double theplu::yat::statistics::averager_base4< Averager4 >::central_moment4 ( void  ) const
inlineinherited

Fourth central moment.

Fourth central moment is calculated as $ \frac{1}{n} \sum (x_i-m)^4 $ where m is the mean.

double theplu::yat::statistics::averager_base2< Averager4 >::cv ( void  ) const
inlineinherited

Coeffient of variation.

Coeffient of variation (cv) is defined as ratio between the standard deviation and the mean: $ \frac{\sigma}{\mu} $.

Returns
standard deviation divided by mean.
double theplu::yat::statistics::averager_base4< Averager4 >::kurtosis ( void  ) const
inlineinherited

Kurtosis.

Kurtosis is calculated as $ \frac{1}{n} \sum (x-m)^4 / \sigma^4 - 3.0 $ where m is mean, and $ \sigma $ is standard deviation.

Note
this function uses a biased variance estimate [1/n] compared to kurtosis(utility::VectorBase&), which uses an unbiased variance estimate [1/(n-1)] and may thus give different results for small n.
double theplu::yat::statistics::averager_base< Averager4 >::mean ( void  ) const
inlineinherited

mean

Returns
Mean of presented data, $ \frac{1}{n}\sum x_i $
long theplu::yat::statistics::averager_base< Averager4 >::n ( void  ) const
inlineinherited

number of data points

Returns
Number of data points
template<class Derived >
const Averager4 & theplu::yat::statistics::Averager4::operator+= ( const averager_base4< Derived > &  rhs)

Third central moment.

Access Averager that holds first and second moments

Returns
$ \frac{1}{N} \sum (x_i-m)^3 $ Fourth central moment
$ \frac{1}{N} \sum (x_i-m)^4 $ The kurtosis is calculated as $ M_4 / M_2^2 - 3 $ where $ M_4 $ and $ M_2 $ are the fourth central moment and variance, respectively.
kurtosis
See Also
central_moment4 and Averager::variance
Note
This function uses a biased estimator of the variance (see Averager::variance) whereas function kurtosis(const utility::VectorBase&) uses an unbiased estimator (Averger::variance_unbiased) and therefore the result may differ for small N. The skewness is calculated as $ M_3 / {\sigma}^3 $ where $ M_3 $ and $ \sigma $ are the third central moment and standard deviation, respectively.
Returns
skewness
See Also
central_moment3 and Averager::std
Note
This function uses a biased estimator of the variance (see Averager::variance) whereas function skewness(const utility::VectorBase&) uses an unbiased estimator (Averger::variance_unbiased) and therefore the result may differ for small N.
void theplu::yat::statistics::averager_base< Averager4 >::rescale ( double  a)
inlineinherited

Rescales the object.

$ \forall x_i \rightarrow a*x_i $,

double theplu::yat::statistics::averager_base< Averager4 >::rescale1 ( double  x)
protectedinherited

rescale as $ mean \rightarrow x mean $

double theplu::yat::statistics::averager_base2< Averager4 >::rescale2 ( double  x)
protectedinherited

rescales $ cm2 \rightarrow x^2 cm2 $ and calles rescale1(double)

double theplu::yat::statistics::averager_base3< Averager4 >::rescale3 ( double  x)
protectedinherited

rescales $ cm3 = x^3 cm3 $ and calles rescale2(double)

double theplu::yat::statistics::averager_base4< Averager4 >::rescale4 ( double  x)
protectedinherited

rescales $ cm4 = x^4 cm4 $ and calles rescale2(double)

void theplu::yat::statistics::averager_base< Averager4 >::reset ( void  )
inlineinherited

Reset object.

Restore Averager as if data were never added

double theplu::yat::statistics::averager_base3< Averager4 >::skewness ( void  ) const
inlineinherited

Skewness.

Skewness is calculated as $ \frac{1}{n} \sum (x_i-m) / \sigma^3 $ where $ \sigma $ is standard deviation.

Note
this function uses a biased variance estimate [1/n] compared to skewness(utility::VectorBase&), which uses an unbiased variance estimate [1/(n-1)] and may thus give different results for small n.
double theplu::yat::statistics::averager_base2< Averager4 >::standard_error ( void  ) const
inlineinherited
Returns
Standard error, i.e. standard deviation of the mean $ \sqrt{variance()/n} $
double theplu::yat::statistics::averager_base2< Averager4 >::std ( void  ) const
inlineinherited

The standard deviation is defined as the square root of the variance.

Returns
The standard deviation, root of the variance().
double theplu::yat::statistics::averager_base2< Averager4 >::std ( double  m) const
inlineinherited

The standard deviation is defined as the square root of the variance.

Returns
Standard deviation around m, root of the variance(m).
double theplu::yat::statistics::averager_base< Averager4 >::sum_x ( void  ) const
inlineinherited
Returns
The sum of data values
double theplu::yat::statistics::averager_base3< Averager4 >::sum_x3_centered ( void  ) const
inlineinherited
Returns
sum cubed centered

$ \sum (x_i-m)^3 $

double theplu::yat::statistics::averager_base4< Averager4 >::sum_x4_centered ( void  ) const
inlineinherited

sum quadrupled centered

Calculated as $ \frac{1}{n} \sum (x_i-m)^4 $

double theplu::yat::statistics::averager_base2< Averager4 >::sum_xx ( void  ) const
inlineinherited
Returns
The sum of squares
double theplu::yat::statistics::averager_base2< Averager4 >::sum_xx_centered ( void  ) const
inlineinherited
Returns
$ \sum_i (x_i-m)^2 $
double theplu::yat::statistics::averager_base2< Averager4 >::variance ( double  m) const
inlineinherited

The variance with known mean.

The variance is calculated as $ \frac{1}{n}\sum (x_i-m)^2 $.

Returns
Variance when the mean is known to be m.
double theplu::yat::statistics::averager_base2< Averager4 >::variance ( void  ) const
inlineinherited

The estimated variance.

The variance is calculated as $ \frac{1}{N}\sum_i (x_i-m)^2 $, where $ m $ is the mean.

Returns
Estimation of variance
double theplu::yat::statistics::averager_base2< Averager4 >::variance_unbiased ( void  ) const
inlineinherited

The variance is calculated using the $ (n-1) $ correction, which means it is the best unbiased estimator of the variance $ \frac{1}{N-1}\sum_i (x_i-m)^2 $, where $ m $ is the mean.

Returns
unbiased estimation of variance

Member Data Documentation

double theplu::yat::statistics::averager_base2< Averager4 >::cm2_
protectedinherited

sum of values squared values centralized $ \sum (x-m)^2 $

double theplu::yat::statistics::averager_base3< Averager4 >::cm3_
protectedinherited

sum cubed centered

long int theplu::yat::statistics::averager_base< Averager4 >::n_
protectedinherited

number of data points


The documentation for this class was generated from the following file:

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5