Changeset 890 for trunk/yat/statistics

Ignore:
Timestamp:
Sep 25, 2007, 11:35:25 AM (16 years ago)
Message:

Refs #245 #246 #247

Location:
trunk/yat/statistics
Files:
4 edited

Unmodified
Added
Removed
• trunk/yat/statistics/AveragerPairWeighted.cc

 r865 double AveragerPairWeighted::msd(void) const { return ( x_.sum_wxx()+y_.sum_wxx()-2*wxy_)/w_; return sum_squared_deviation()/w_; } x_.reset(); y_.reset(); wxy_=0; w_=0; } double AveragerPairWeighted::sum_squared_deviation(void) const { return x_.sum_wxx()+y_.sum_wxx()-2*wxy_; } double AveragerPairWeighted::sum_w(void) const
• trunk/yat/statistics/AveragerPairWeighted.h

 r865 /// /// @return Sum of weighted squared deviation between x and y \f$/// \sum (w_xx-wyy)^2 \f$ /// double sum_squared_deviation(void) const; /// /// @return \f$\sum w_xw_y \f$ /// }; /** \brief adding a ranges of values to AveragerPairWeighted \a ap */ template void add(AveragerPairWeighted& ap, Iter1 first1, Iter1 last1, Iter2 first2) { for ( ; first1 != last1; ++first1, ++first2) ap.add(first1.data(), first2.data(),first1.weight(),first2.weight()); } template
• trunk/yat/statistics/euclidean_vector_distance.h

 r889 #include "AveragerPair.h" #include "AveragerPairWeighted.h" #include "vector_distance.h" } /// /// implementation for distances between vectors /// (containers with random access iterators) using a Euclidean /// distance measure and iterators to weighted containers. /// template double vector_distance(Iter beg1,Iter end1, Iter beg2, const euclidean_vector_distance_tag& disttype, std::weighted_random_access_iterator_tag) { AveragerPairWeighted ap; add(ap,beg1,end1,beg2); return sqrt(ap.sum_squared_deviation()); } }}} // of namespace statistics, yat, and theplu
• trunk/yat/statistics/pearson_vector_distance.h

 r889 } /// /// implementation for distances between vectors /// (containers with random access iterators) using a Pearson /// distance measure and iterators to unweighted containers. /// template double vector_distance(Iter beg1,Iter end1, Iter beg2, const pearson_vector_distance_tag& disttype, std::weighted_random_access_iterator_tag) { AveragerPairWeighted ap; add(ap,beg1,end1,beg2); return 1-ap.correlation(); } }}} // of namespace statistics, yat, and theplu
Note: See TracChangeset for help on using the changeset viewer.