#include <yat/statistics/PearsonDistance.h>
Public Member Functions | |
template<typename ForwardIterator1, typename ForwardIterator2> | |
double | operator() (ForwardIterator1 beg1, ForwardIterator1 end1, ForwardIterator2 beg2) const |
Calculates the Pearson correlation distance between elements of two ranges. |
This class is modelling the concept Distance.
double theplu::yat::statistics::PearsonDistance::operator() | ( | ForwardIterator1 | beg1, | |
ForwardIterator1 | end1, | |||
ForwardIterator2 | beg2 | |||
) | const [inline] |
Calculates the Pearson correlation distance between elements of two ranges.
If elements of both ranges are unweighted the distance is calculated as , where and are the two points and C is the Pearson correlation.
If elements of one or both of ranges have weights the distance is calculated as , where and and are weights for the elements of the first and the second range, respectively, and and correspondingly for . If the elements of one of the two ranges are unweighted, the weights for these elements are set to unity.