Changeset 1115 for trunk/yat/statistics
- Timestamp:
- Feb 21, 2008, 8:20:59 PM (15 years ago)
- Location:
- trunk/yat/statistics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/statistics/EuclideanDistance.h
r1093 r1115 38 38 /// 39 39 /// @brief Calculates the Euclidean distance between two points 40 /// stored in 1-dimensional containers. Implements the concept \ref 41 /// concept_distance. 40 /// given by elements of ranges. 41 /// 42 /// This class is modelling the concept \ref concept_distance. 42 43 /// 43 44 /// … … 45 46 { 46 47 /** 47 \brief Calculates the Euclidean distance between two ranges. 48 \brief Calculates the Euclidean distance between elements of 49 two ranges. 48 50 49 If both ranges are unweighted the distance is calculated as \f$ 50 \sqrt{\sum (x_i-y_i)^2 } \f$ 51 If elements of both ranges are unweighted the distance is 52 calculated as \f$ \sqrt{\sum (x_i-y_i)^2 } \f$, where \f$ x_i 53 \f$ and \f$ y_i \f$ are elements of the first and second range, 54 respectively. 51 55 52 Else distance is calculated as \f$ N \frac{\sum 53 w_xw_y(x-y)^2}{\sum w_xw_y} \f$ 56 If elements of one or both of ranges have weights the distance 57 is calculated as \f$ \sqrt{N \sum 58 w_{x,i}w_{y,i}(x_i-y_i)^2/\sum w_{x,i}w_{y,i}} \f$, where \f$ N 59 \f$ is the number of elements in the two ranges and \f$ w_x \f$ 60 and \f$ w_y \f$ are weights for the elements of the first and 61 the second range, respectively. If the elements of one of the 62 two ranges are unweighted, the weights for these elements are 63 set to unity. 54 64 */ 55 65 template <typename Iter1, typename Iter2> -
trunk/yat/statistics/PearsonDistance.h
r1092 r1115 35 35 36 36 /// 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. 38 38 /// 39 /// This class is modelling the concept \ref concept_distance. 39 40 /// 40 41 struct PearsonDistance 41 42 { 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 */ 45 61 template <typename Iter1, typename Iter2> 46 62 double operator()
Note: See TracChangeset
for help on using the changeset viewer.