Changeset 916 for trunk/yat/statistics/AveragerPairWeighted.cc
 Timestamp:
 Sep 30, 2007, 2:50:10 AM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/statistics/AveragerPairWeighted.cc
r899 r916 49 49 return; 50 50 } 51 assert(!std::isnan(x) && "x is nan"); 52 assert(!std::isnan(y) && "y is nan"); 53 assert(!std::isnan(wx) && "wx is nan"); 54 assert(!std::isnan(wy) && "wy is nan"); 51 55 double w=wx*wy; 52 56 x_.add(x,w); … … 84 88 double AveragerPairWeighted::correlation(void) const 85 89 { 86 return covariance() / ( x_.std()*y_.std() ); 90 return ( x_.variance()>0 && y_.variance()>0 ? 91 covariance() / sqrt(x_.variance()*y_.variance()) : 0 ); 87 92 } 88 93
Note: See TracChangeset
for help on using the changeset viewer.