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

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

#include <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

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.

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

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

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

Returns:
The covariance.
Returns:
The mean of xy.
Returns:
Average squared deviation between x and y $ \frac{1}{N} \sum (x-y)^2 $
Returns:
The number of pair of data points.
const AveragerPair& theplu::yat::statistics::AveragerPair::operator+= ( const AveragerPair )

Operator to add another Averager

Returns:
Sum of squared deviation between x and y $ \sum (x-y)^2 $
Returns:
The sum of xy.
Returns:
$ \sum_i (x_i-m_x)(y_i-m_y) $
Returns:
A const refencer to the averager object for x.
Returns:
A const reference to the averager object for y

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

Generated on Thu Dec 20 2012 03:12:59 for yat by  doxygen 1.8.0-20120409