# Changeset 1115 for trunk/yat/statistics/PearsonDistance.h

Ignore:
Timestamp:
Feb 21, 2008, 8:20:59 PM (14 years ago)
Message:

Fixes #254 and #295

File:
1 edited

### Legend:

Unmodified
 r1092 /// /// @brief Calculates the %Pearson correlation distance between two points stored in 1-dimensional containers. Implements the concept \ref concept_distance. /// @brief Calculates the %Pearson correlation distance between two points given by elements of ranges. /// /// This class is modelling the concept \ref concept_distance. /// struct PearsonDistance { /// /// @brief Calculates the %Pearson correlation distance between two ranges. /// /** \brief Calculates the %Pearson correlation distance between elements of two ranges. If elements of both ranges are unweighted the distance is calculated as \f$1-\mbox{C}(x,y) \f$, where \f$x \f$ and \f$y \f$ 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 \f$1-[\sum w_{x,i}w_{y,i}(x_i-y_i)^2/(\sum w_{x,i}w_{y,i}(x_i-m_x)^2\sum w_{x,i}w_{y,i}(y_i-m_y)^2)] \f$, where and \f$w_x \f$ and \f$w_y \f$ are weights for the elements of the first and the second range, respectively, and \f$m_x=\sum w_{x,i}w_{y,i}x_i/\sum w_{x,i}w_{y,i} \f$ and correspondingly for \f$m_y \f$.  If the elements of one of the two ranges are unweighted, the weights for these elements are set to unity. */ template double operator()