#include <yat/statistics/PearsonDistance.h>
Public Member Functions | |
template<typename Iter1, typename Iter2> | |
double | operator() (Iter1 beg1, Iter1 end1, Iter2 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() | ( | Iter1 | beg1, | |
Iter1 | end1, | |||
Iter2 | 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.