Changeset 1595 for trunk/yat/statistics


Ignore:
Timestamp:
Oct 22, 2008, 11:58:26 PM (13 years ago)
Author:
Peter
Message:

adding a signed_score in KS statistics

Location:
trunk/yat/statistics
Files:
2 edited

Legend:

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

    r1594 r1595  
    101101  double KolmogorovSmirnov::score(void) const
    102102  {
     103    return std::abs(signed_score());
     104  }
     105
     106
     107  double KolmogorovSmirnov::signed_score(void) const
     108  {
    103109    if (cached_)
    104110      return score_;
     
    111117    utility::abs<double> a;
    112118    using utility::make_compose_f_gx_hy;
    113     score_ = std::abs(*std::max_element(v.begin(), v.end(),
    114                                         make_compose_f_gx_hy(l, a, a)));
     119    score_ = *std::max_element(v.begin(), v.end(),
     120                               make_compose_f_gx_hy(l, a, a));
     121    cached_=true;
    115122    return score_;
    116123  }
  • trunk/yat/statistics/KolmogorovSmirnov.h

    r1593 r1595  
    8585    double score(void) const;
    8686
     87    /**
     88       Same as score() but keeping the sign, in other words,
     89       abs(signed_score())==score()
     90
     91       \since New in yat 0.5
     92     */
     93    double signed_score(void) const;
     94
    8795  private:
    8896    void scores(std::vector<double>&) const;
Note: See TracChangeset for help on using the changeset viewer.