Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(20)  |  Call(18)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_maths/test_stats/test_ks.py   cogent(Download)
#!/usr/bin/env python
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.ks import pkolmogorov1x, pkolmogorov2x, pkstwo,\
                                psmirnov2x
from cogent.maths.stats.test import ks_test, ks_boot
    def test_ks2x(self):
        """KS two-sample, 2-sided should match answers from R"""
        D, Pval = ks_test(self.x1, self.x2)
        self.assertFloatEqual((D, Pval), (0.46, 3.801e-05), eps=1e-4)
        D, Pval = ks_test(self.x1, self.x2, exact=False)
        self.assertFloatEqual((D, Pval), (0.46, 5.084e-05), eps=1e-4)
        D, Pval = ks_test(self.x1, self.x2[:20])
        self.assertFloatEqual((D,Pval), (0.53, 0.0003576), eps=1e-4)
        D, Pval = ks_test(self.x2[:20], self.x1)

src/p/y/pycogent-HEAD/tests/test_maths/test_stats/test_ks.py   pycogent(Download)
#!/usr/bin/env python
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.ks import pkolmogorov1x, pkolmogorov2x, pkstwo,\
                                psmirnov2x
from cogent.maths.stats.test import ks_test, ks_boot
    def test_ks2x(self):
        """KS two-sample, 2-sided should match answers from R"""
        D, Pval = ks_test(self.x1, self.x2)
        self.assertFloatEqual((D, Pval), (0.46, 3.801e-05), eps=1e-4)
        D, Pval = ks_test(self.x1, self.x2, exact=False)
        self.assertFloatEqual((D, Pval), (0.46, 5.084e-05), eps=1e-4)
        D, Pval = ks_test(self.x1, self.x2[:20])
        self.assertFloatEqual((D,Pval), (0.53, 0.0003576), eps=1e-4)
        D, Pval = ks_test(self.x2[:20], self.x1)