yat  0.20.3pre
Public Member Functions | Related Functions | List of all members
theplu::yat::statistics::AveragerPair Class Reference

Class for taking care of mean and covariance of two variables. More...

#include <yat/statistics/AveragerPair.h>

Public Member Functions

 AveragerPair (void)
 The default constructor.
 
 AveragerPair (const AveragerPair &)
 
void add (const double x, const double y, const long n=1)
 
double ccc (void) const
 Concordence correlation coefficient. More...
 
double correlation (void) const
 
double covariance (void) const
 
double mean_xy (void) const
 
double msd (void) const
 
long n (void) const
 
void reset (void)
 Reset everything to zero.
 
double sum_xy (void) const
 
double sum_squared_deviation (void) const
 
double sum_xy_centered (void) const
 
const Averagerx_averager (void) const
 
const Averagery_averager (void) const
 
const AveragerPairoperator= (const AveragerPair &a)
 The assigment operator.
 
const AveragerPairoperator+= (const AveragerPair &)
 

Related Functions

(Note that these are not member functions.)

template<class InputIterator1 , class InputIterator2 >
void add (AveragerPair &ap, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
 adding data from two ranges to AveragerPair ap More...
 

Detailed Description

Class for taking care of mean and covariance of two variables.

See also
Averager AveragerWeighted AveragerPairWeighted

Constructor & Destructor Documentation

◆ AveragerPair()

theplu::yat::statistics::AveragerPair::AveragerPair ( const AveragerPair )

The copy constructor

Member Function Documentation

◆ add()

void theplu::yat::statistics::AveragerPair::add ( const double  x,
const double  y,
const long  n = 1 
)

Adding n pairs of data points with value x and y.

◆ ccc()

double theplu::yat::statistics::AveragerPair::ccc ( void  ) const

Concordence correlation coefficient.

$ \frac{\sum_i (x_i-m_x)(y_i-m_y)}{\sum_i (x_i-m_x)^2+\sum_i (y_i-m_y)^2 + n(m_x-m_y)^2} $

◆ correlation()

double theplu::yat::statistics::AveragerPair::correlation ( void  ) const

$ \frac{\sum_i (x_i-m_x)(y_i-m_y)}{\sqrt{\sum_i (x_i-m_x)^2\sum_i (y_i-m_y)^2}} $

Returns
Pearson correlation coefficient.

◆ covariance()

double theplu::yat::statistics::AveragerPair::covariance ( void  ) const

Calculating covariance using $ \frac{1}{N}\sum_i (x_i-m_x)(y_i-m_y) $, where $ m $ is the mean.

Returns
The covariance.

◆ mean_xy()

double theplu::yat::statistics::AveragerPair::mean_xy ( void  ) const
Returns
The mean of xy.

◆ msd()

double theplu::yat::statistics::AveragerPair::msd ( void  ) const
Returns
Average squared deviation between x and y $ \frac{1}{N} \sum (x-y)^2 $

◆ n()

long theplu::yat::statistics::AveragerPair::n ( void  ) const
Returns
The number of pair of data points.

◆ operator+=()

const AveragerPair& theplu::yat::statistics::AveragerPair::operator+= ( const AveragerPair )

Operator to add another Averager

◆ sum_squared_deviation()

double theplu::yat::statistics::AveragerPair::sum_squared_deviation ( void  ) const
Returns
Sum of squared deviation between x and y $ \sum (x-y)^2 $

◆ sum_xy()

double theplu::yat::statistics::AveragerPair::sum_xy ( void  ) const
Returns
The sum of xy.

◆ sum_xy_centered()

double theplu::yat::statistics::AveragerPair::sum_xy_centered ( void  ) const
Returns
$ \sum_i (x_i-m_x)(y_i-m_y) $

◆ x_averager()

const Averager& theplu::yat::statistics::AveragerPair::x_averager ( void  ) const
Returns
A const refencer to the averager object for x.

◆ y_averager()

const Averager& theplu::yat::statistics::AveragerPair::y_averager ( void  ) const
Returns
A const reference to the averager object for y

Friends And Related Function Documentation

◆ add()

template<class InputIterator1 , class InputIterator2 >
void add ( AveragerPair ap,
InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2 
)
related

adding data from two ranges to AveragerPair ap

Type Requirements:


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