Ignore:
Timestamp:
Feb 21, 2008, 8:20:59 PM (14 years ago)
Author:
Markus Ringnér
Message:

Fixes #254 and #295

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/PearsonDistance.h

    r1092 r1115  
    3535
    3636  ///
    37   /// @brief Calculates the %Pearson correlation distance between two points stored in 1-dimensional containers. Implements the concept \ref concept_distance.
     37  /// @brief Calculates the %Pearson correlation distance between two points given by elements of ranges.
    3838  ///
     39  /// This class is modelling the concept \ref concept_distance.
    3940  ///
    4041  struct PearsonDistance
    4142  {
    42     ///
    43     /// @brief Calculates the %Pearson correlation distance between two ranges.
    44     ///
     43    /**
     44       \brief Calculates the %Pearson correlation distance between
     45       elements of two ranges.
     46   
     47       If elements of both ranges are unweighted the distance is
     48       calculated as \f$ 1-\mbox{C}(x,y) \f$, where \f$ x \f$ and \f$
     49       y \f$ are the two points and C is the %Pearson correlation.
     50
     51       If elements of one or both of ranges have weights the distance
     52       is calculated as \f$ 1-[\sum w_{x,i}w_{y,i}(x_i-y_i)^2/(\sum
     53       w_{x,i}w_{y,i}(x_i-m_x)^2\sum w_{x,i}w_{y,i}(y_i-m_y)^2)] \f$,
     54       where and \f$ w_x \f$ and \f$ w_y \f$ are weights for the
     55       elements of the first and the second range, respectively, and
     56       \f$ m_x=\sum w_{x,i}w_{y,i}x_i/\sum w_{x,i}w_{y,i} \f$ and
     57       correspondingly for \f$ m_y \f$.  If the elements of one of the
     58       two ranges are unweighted, the weights for these elements are
     59       set to unity.
     60    */   
    4561    template <typename Iter1, typename Iter2>
    4662    double operator()
Note: See TracChangeset for help on using the changeset viewer.