yat  0.20.3pre
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
theplu::yat::statistics::averager_base4< Derived > Class Template Referenceabstract

#include <yat/statistics/averager_base.h>

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

Public Member Functions

 averager_base4 (void)
 Constructor.
 
virtual ~averager_base4 (void)=0
 Destructor.
 
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
 

Detailed Description

template<class Derived>
class theplu::yat::statistics::averager_base4< Derived >

Base class for averagers calculating first (mean), second (variance), third moment, and fourth moment.

For requirement on Derived see averager_base.

Since
yat 0.9

Member Function Documentation

◆ add()

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

add a data point

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

◆ add1() [1/2]

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

add n data points with value x

◆ add1() [2/2]

template<class Derived >
void theplu::yat::statistics::averager_base< Derived >::add1 ( double  delta)
protectedinherited

add one data point with value delta + mean()

◆ add2() [1/2]

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

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

◆ add2() [2/2]

template<class Derived >
void theplu::yat::statistics::averager_base2< Derived >::add2 ( double  delta)
protectedinherited

add one data point with value delta + mean()

◆ add3() [1/2]

template<class Derived >
void theplu::yat::statistics::averager_base3< Derived >::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.

◆ add3() [2/2]

template<class Derived >
void theplu::yat::statistics::averager_base3< Derived >::add3 ( double  delta)
protectedinherited

add one data point with value delta + mean()

◆ add4() [1/2]

template<class Derived >
void theplu::yat::statistics::averager_base4< Derived >::add4 ( double  mean,
double  cm2,
double  cm3,
double  cm4,
long int  n 
)
protected

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

◆ add4() [2/2]

template<class Derived >
void theplu::yat::statistics::averager_base4< Derived >::add4 ( double  delta)
protected

add one data point with value delta + mean()

◆ central_moment3()

template<class Derived>
double theplu::yat::statistics::averager_base3< Derived >::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.

◆ central_moment4()

template<class Derived>
double theplu::yat::statistics::averager_base4< Derived >::central_moment4 ( void  ) const
inline

Fourth central moment.

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

◆ cv()

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::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.

◆ kurtosis()

template<class Derived>
double theplu::yat::statistics::averager_base4< Derived >::kurtosis ( void  ) const
inline

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.

◆ mean()

template<class Derived>
double theplu::yat::statistics::averager_base< Derived >::mean ( void  ) const
inlineinherited

mean

Returns
Mean of presented data, $ \frac{1}{n}\sum x_i $

◆ n()

template<class Derived>
long theplu::yat::statistics::averager_base< Derived >::n ( void  ) const
inlineinherited

number of data points

Returns
Number of data points

◆ rescale()

template<class Derived>
void theplu::yat::statistics::averager_base< Derived >::rescale ( double  a)
inlineinherited

Rescales the object.

$ \forall x_i \rightarrow a*x_i $,

◆ rescale1()

template<class Derived >
double theplu::yat::statistics::averager_base< Derived >::rescale1 ( double  x)
protectedinherited

rescale as $ mean \rightarrow x mean $

◆ rescale2()

template<class Derived >
double theplu::yat::statistics::averager_base2< Derived >::rescale2 ( double  x)
protectedinherited

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

◆ rescale3()

template<class Derived >
double theplu::yat::statistics::averager_base3< Derived >::rescale3 ( double  x)
protectedinherited

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

◆ rescale4()

template<class Derived >
double theplu::yat::statistics::averager_base4< Derived >::rescale4 ( double  x)
protected

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

◆ reset()

template<class Derived>
void theplu::yat::statistics::averager_base< Derived >::reset ( void  )
inlineinherited

Reset object.

Restore Averager as if data were never added

◆ skewness()

template<class Derived>
double theplu::yat::statistics::averager_base3< Derived >::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.

◆ standard_error()

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::standard_error ( void  ) const
inlineinherited
Returns
Standard error, i.e. standard deviation of the mean $ \sqrt{variance()/n} $

◆ std() [1/2]

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::std ( void  ) const
inlineinherited

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

Returns
The standard deviation, root of the variance().

◆ std() [2/2]

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::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).

◆ sum_x()

template<class Derived>
double theplu::yat::statistics::averager_base< Derived >::sum_x ( void  ) const
inlineinherited
Returns
The sum of data values

◆ sum_x3_centered()

template<class Derived>
double theplu::yat::statistics::averager_base3< Derived >::sum_x3_centered ( void  ) const
inlineinherited
Returns
sum cubed centered

$ \sum (x_i-m)^3 $

◆ sum_x4_centered()

template<class Derived>
double theplu::yat::statistics::averager_base4< Derived >::sum_x4_centered ( void  ) const
inline

sum quadrupled centered

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

◆ sum_xx()

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::sum_xx ( void  ) const
inlineinherited
Returns
The sum of squares

◆ sum_xx_centered()

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::sum_xx_centered ( void  ) const
inlineinherited
Returns
$ \sum_i (x_i-m)^2 $

◆ variance() [1/2]

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::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.

◆ variance() [2/2]

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::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

◆ variance_unbiased()

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::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

◆ cm2_

template<class Derived>
double theplu::yat::statistics::averager_base2< Derived >::cm2_
protectedinherited

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

◆ cm3_

template<class Derived>
double theplu::yat::statistics::averager_base3< Derived >::cm3_
protectedinherited

sum cubed centered

◆ n_

template<class Derived>
long int theplu::yat::statistics::averager_base< Derived >::n_
protectedinherited

number of data points


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

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14