theplu::yat::statistics::AveragerPairWeighted Class Reference

Class for taking care of mean and covariance of two variables in a weighted manner. More...

#include <yat/statistics/AveragerPairWeighted.h>

List of all members.

Public Member Functions

 AveragerPairWeighted (void)
 The default constructor.
void add (const double x, const double y, const double wx, const double wy)
double correlation (void) const
 Pearson correlation coefficient.
double covariance (void) const
double msd (void) const
double n (void) const
void reset (void)
 Reset everything to zero.
double sum_w (void) const
double sum_xy (void) const
double sum_xy_centered (void) const
const AveragerWeightedx_averager (void) const
const AveragerWeightedy_averager (void) const


Detailed Description

Class for taking care of mean and covariance of two variables in a weighted manner.

See also:
Weighted Statistics
If nothing else stated, each function fulfills the following:

See also:
Averager AveragerWeighted AveragerPair

Member Function Documentation

void theplu::yat::statistics::AveragerPairWeighted::add ( const double  x,
const double  y,
const double  wx,
const double  wy 
)

Adding a pair of data points with value x and y, and their weights. If either of the weights are zero the addition is ignored

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

Pearson correlation coefficient.

Returns:
$ \frac{\sum w_xw_y (x-m_x)(y-m_y)}{\sqrt{\sum /// w_xw_y (y-m_y)^2\sum w_xw_y (y-m_y)^2}} $ where m is calculated as $ m_x = \frac {\sum w_xw_yx}{\sum w} $

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

$ \frac{\sum w_xw_y (x-m_x)(y-m_y)}{\sum w_xw_y} $ where m is calculated as $ m_x = \frac {\sum w_xw_yx}{\sum w} $

double theplu::yat::statistics::AveragerPairWeighted::msd ( void   )  const

Returns:
$ \frac{\sum w_xw_y(x-y)^2}{\sum w_xw_y} $

double theplu::yat::statistics::AveragerPairWeighted::n ( void   )  const

Returns:
$ \frac{\left(\sum w_x w_y\right)^2}{\sum w_x^2w_y^2} $

double theplu::yat::statistics::AveragerPairWeighted::sum_w ( void   )  const

Returns:
$ \sum w_xw_y $

double theplu::yat::statistics::AveragerPairWeighted::sum_xy ( void   )  const

Returns:
$ \sum w_xw_yxy $

double theplu::yat::statistics::AveragerPairWeighted::sum_xy_centered ( void   )  const

Returns:
$ \sum w_xw_y (x-m_x)(y-m_y) $ where m is calculated as $ m_x = \frac {\sum w_xw_yx}{\sum w} $

const AveragerWeighted& theplu::yat::statistics::AveragerPairWeighted::x_averager ( void   )  const

Note:
the weights are calculated as $ w = w_x * w_y $
Returns:
AveragerWeighted for x

const AveragerWeighted& theplu::yat::statistics::AveragerPairWeighted::y_averager ( void   )  const

Note:
the weights are calculated as $ w = w_x * w_y $
Returns:
AveragerWeighted for y


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

Generated on Tue Jan 18 02:20:11 2011 for yat by  doxygen 1.5.5