Changeset 2998


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

New class KolmogorovSmirnovOneSample?. closes #686

Location:
trunk
Files:
2 added
2 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}
  • trunk/yat/statistics/Makefile.am

    r2932 r2998  
    3131  yat/statistics/Histogram.cc \
    3232  yat/statistics/Kendall.cc yat/statistics/KolmogorovSmirnov.cc \
     33  yat/statistics/KolmogorovSmirnovOneSample.cc \
    3334  yat/statistics/Pearson.cc \
    3435  yat/statistics/PearsonCorrelation.cc yat/statistics/Percentiler.cc \
     
    5960  $(srcdir)/yat/statistics/Kendall.h \
    6061  $(srcdir)/yat/statistics/KolmogorovSmirnov.h \
     62  $(srcdir)/yat/statistics/KolmogorovSmirnovOneSample.h \
    6163  $(srcdir)/yat/statistics/Pearson.h \
    6264  $(srcdir)/yat/statistics/PearsonCorrelation.h \
Note: See TracChangeset for help on using the changeset viewer.