Changeset 1626


Ignore:
Timestamp:
Nov 15, 2008, 5:01:46 PM (13 years ago)
Author:
Peter
Message:

closes #457 - kolmogorov_smirnov_test fails on Mac OS 10.4

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/kolmogorov_smirnov_test.cc

    r1618 r1626  
    4242  test_one_sample(suite);
    4343  test_two_sample(suite);
    44   //test_p_value(suite);
     44  test_p_value(suite);
    4545  test_reset(suite);
    4646
     
    116116    ks.add(i+14.5, false);
    117117  }
     118  suite.add(suite.equal(ks.score(), 0.15, 10));
     119
    118120  statistics::Averager a;
    119121  for (size_t n=0; n<100; ++n) {
  • trunk/yat/statistics/KolmogorovSmirnov.cc

    r1617 r1626  
    2929#include <deque>
    3030#include <functional>
     31#include <limits>
    3132
    3233namespace theplu {
     
    8485      targets.push_back(i->second);
    8586
     87    double score_threshold = score()-10*std::numeric_limits<double>().epsilon();
     88
    8689    for (size_t i=0; i<perm; ++i){
    8790      random::random_shuffle(targets.begin(), targets.end());
     
    9295        ks.add(iter->first.first, *target_i, iter->first.second);
    9396     
    94       if (ks.score()>=score())
     97      if (ks.score()>=score_threshold)
    9598        ++count;
    9699    }
Note: See TracChangeset for help on using the changeset viewer.