Exemple #1
0
    def test_uniform_random(self):
        """...Test uniform random numbers simulation
        """
        seeded_sample = \
            [0.21519787, 0.34657955, 0.52366921, 0.0583405, 0.83635939]

        self._test_dist_with_seed(seeded_sample, test_uniform)

        # Statistical tests
        sample = test_uniform(self.stat_size, self.test_seed)
        p, _ = stats.kstest(sample, 'uniform')
        self.assertLess(p, 0.05)
Exemple #2
0
    def test_uniform_random_with_bounds(self):
        """...Test uniform random numbers with bounds simulation
        """
        a = -2
        b = 5

        seeded_sample = \
            [-0.4936149, 0.42605685, 1.66568447, -1.59161653, 3.85451574]

        self._test_dist_with_seed(seeded_sample, test_uniform, a, b)

        # Statistical tests
        sample = test_uniform(a, b, self.stat_size, self.test_seed)
        p, _ = stats.kstest(sample, 'uniform', (a, b - a))
        self.assertLess(p, 0.05)