Ignore:
Timestamp:
Mar 14, 2013, 9:08:54 AM (9 years ago)
Author:
Peter
Message:

New class KolmogorovSmirnovOneSample?. closes #686

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/kolmogorov_smirnov.cc

    r2881 r2998  
    22
    33/*
    4   Copyright (C) 2008, 2009, 2010, 2012 Peter Johansson
     4  Copyright (C) 2008, 2009, 2010, 2012, 2013 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2727#include "yat/statistics/Averager.h"
    2828#include "yat/statistics/KolmogorovSmirnov.h"
     29#include "yat/statistics/KolmogorovSmirnovOneSample.h"
    2930
    3031#include <boost/concept_archetype.hpp>
     
    4748void test_ties(test::Suite&);
    4849void test_compile(void);
     50void test_ks_one_sample(test::Suite&);
    4951
    5052int main(int argc, char* argv[])
     
    6163  test_compile();
    6264  test_remove(suite);
     65  test_ks_one_sample(suite);
    6366
    6467  return suite.return_value();
     
    270273  ks.shuffle();
    271274}
     275
     276
     277void test_ks_one_sample(test::Suite& suite)
     278{
     279  suite.err() << "testing one sample" << std::endl;
     280  statistics::KolmogorovSmirnovOneSample ks;
     281  for (size_t i=0; i<=10; ++i)
     282    ks.add(i/10.0);
     283  suite.out() << "score: " << ks.score() << "\n";
     284  suite.out() << "P: " << ks.p_value() << "\n";
     285  ks.remove(0);
     286  ks.remove(0.1);
     287  ks.remove(0.2);
     288  ks.remove(0.3);
     289  suite.out() << "P: " << ks.p_value() << "\n";
     290  suite.out() << "score: " << ks.score() << "\n";
     291  suite.out() << "score: " << ks.signed_score() << "\n";
     292  ks.reset();
     293}
Note: See TracChangeset for help on using the changeset viewer.