# HG changeset patch # User Thorsten Meyer # Date 1291968589 -3600 # Node ID ef65ebb325e994562e2ea505653535c2dd071db6 # Parent 97b12d801b0281c30c8983f561461312564208a5 Add tests to kolmogorov_smirnov_test diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-12-10 Thorsten Meyer + + * statistics/tests/kolmogorov_smirnov_test.m: Add tests. + 2010-12-09 John W. Eaton * plot/private/__pie__.m: Provide diagnositc for invalid diff --git a/scripts/statistics/tests/kolmogorov_smirnov_test.m b/scripts/statistics/tests/kolmogorov_smirnov_test.m --- a/scripts/statistics/tests/kolmogorov_smirnov_test.m +++ b/scripts/statistics/tests/kolmogorov_smirnov_test.m @@ -110,3 +110,18 @@ endif endfunction + +%!error +%! kolmogorov_smirnov_test (1); +%!error +%! kolmogorov_smirnov_test ({}, "unif", 2, 4); +%!error +%! kolmogorov_smirnov_test (1, "not_a_dist"); +%!error +%! kolmogorov_smirnov_test (1, "unif", 2, 4, "bla"); +%!test # for recognition of unifcdf function +%! assert (kolmogorov_smirnov_test (0:100, "unif", 0, 100), 1.0, eps); +%!test # for recognition of logistic_cdf function +%! assert (kolmogorov_smirnov_test (0:100, "logistic"), 0); +%!test # F < G +%! assert (kolmogorov_smirnov_test (50:100, "unif", 0, 50, "<"));