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

Related Functions

(Note that these are not member functions.)

template<class InputIterator1 , class InputIterator2 >
void add (AveragerPairWeighted &ap, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
 adding a ranges of values to AveragerPairWeighted ap
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename InputIterator4 >
void add (AveragerPairWeighted &ap, InputIterator1 x, InputIterator1 xlast, InputIterator2 y, InputIterator3 wx, InputIterator4 wy)
 adding four ranges of values to AveragerPairWeighted ap


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


Friends And Related Function Documentation

template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename InputIterator4 >
void add ( AveragerPairWeighted ap,
InputIterator1  x,
InputIterator1  xlast,
InputIterator2  y,
InputIterator3  wx,
InputIterator4  wy 
) [related]

adding four ranges of values to AveragerPairWeighted ap

Iterators must be unweighted.


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

Generated on Mon Nov 7 02:25:52 2011 for yat by  doxygen 1.5.9