Ignore:
Timestamp:
Feb 22, 2008, 6:01:15 PM (15 years ago)
Author:
Peter
Message:

refs #335 - Changed so Averager classes are consistently returning NaN when Averager is empty or for some other reason the estimation ends up with things like zero by zero division. Previously zero was returned from some functions and Nan from some functions. I did not change anythuing in NCC.

File:
1 edited

Legend:

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

    r1043 r1122  
    2727#include "AveragerPair.h"
    2828#include "Averager.h"
    29 #include "yat/classifier/DataLookup1D.h"
    30 #include "yat/classifier/DataLookupWeighted1D.h"
    3129
    3230#include <cassert>
     
    6361  double AveragerPairWeighted::correlation(void) const
    6462  {
    65     return ( x_.variance()>0 && y_.variance()>0 ?
    66              covariance() / sqrt(x_.variance()*y_.variance()) : 0 );
     63    return covariance() / sqrt(x_.variance()*y_.variance());
    6764  }
    6865
Note: See TracChangeset for help on using the changeset viewer.