Mercurial > hg > octave-avbm
changeset 11340:ef65ebb325e9
Add tests to kolmogorov_smirnov_test
author | Thorsten Meyer <thorsten.meyier@gmx.de> |
---|---|
date | Fri, 10 Dec 2010 09:09:49 +0100 |
parents | 97b12d801b02 |
children | 3c7ba1e3dc21 |
files | scripts/ChangeLog scripts/statistics/tests/kolmogorov_smirnov_test.m |
diffstat | 2 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-12-10 Thorsten Meyer <thorsten.meyier@gmx.de> + + * statistics/tests/kolmogorov_smirnov_test.m: Add tests. + 2010-12-09 John W. Eaton <jwe@octave.org> * plot/private/__pie__.m: Provide diagnositc for invalid
--- a/scripts/statistics/tests/kolmogorov_smirnov_test.m +++ b/scripts/statistics/tests/kolmogorov_smirnov_test.m @@ -110,3 +110,18 @@ endif endfunction + +%!error <Invalid call to kolmogorov_smirnov_test> +%! kolmogorov_smirnov_test (1); +%!error <kolmogorov_smirnov_test: x must be a vector> +%! kolmogorov_smirnov_test ({}, "unif", 2, 4); +%!error <kolmogorov_smirnov_test: no not_a_distcdf or not_a_dist_cdf function found> +%! kolmogorov_smirnov_test (1, "not_a_dist"); +%!error <kolmogorov_smirnov_test: alternative bla not recognized> +%! 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, "<"));