yat  0.10.4pre
Public Member Functions | Related Functions
theplu::yat::statistics::AveragerPair Class Reference

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

#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/statistics/AveragerPair.h>

List of all members.

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.
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

Detailed Description

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

See also:
Averager AveragerWeighted AveragerPairWeighted

Constructor & Destructor Documentation

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

The copy constructor


Member Function Documentation

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.

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} $

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}} $

  \return %Pearson correlation coefficient.
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.
double theplu::yat::statistics::AveragerPair::mean_xy ( void  ) const
Returns:
The mean of xy.
double theplu::yat::statistics::AveragerPair::msd ( void  ) const
Returns:
Average squared deviation between x and y $ \frac{1}{N} \sum (x-y)^2 $
long theplu::yat::statistics::AveragerPair::n ( void  ) const
Returns:
The number of pair of data points.
const AveragerPair& theplu::yat::statistics::AveragerPair::operator+= ( const AveragerPair )

Operator to add another Averager

double theplu::yat::statistics::AveragerPair::sum_squared_deviation ( void  ) const
Returns:
Sum of squared deviation between x and y $ \sum (x-y)^2 $
double theplu::yat::statistics::AveragerPair::sum_xy ( void  ) const
Returns:
The sum of xy.
double theplu::yat::statistics::AveragerPair::sum_xy_centered ( void  ) const
Returns:
$ \sum_i (x_i-m_x)(y_i-m_y) $
const Averager& theplu::yat::statistics::AveragerPair::x_averager ( void  ) const
Returns:
A const refencer to the averager object for x.
const Averager& theplu::yat::statistics::AveragerPair::y_averager ( void  ) const
Returns:
A const reference to the averager object for y

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

Generated on Mon Nov 11 2013 09:41:45 for yat by  doxygen 1.8.1