Exemple #1
0
    def test_gaussian_random(self):
        """...Test gaussian random numbers simulation
        """
        seeded_sample = \
            [-1.1618693, -0.62588897, 0.03748094, -0.69938171, 0.35105305]

        self._test_dist_with_seed(seeded_sample, test_gaussian)

        # Statistical tests
        sample = test_gaussian(self.stat_size, self.test_seed)
        p, _ = stats.kstest(sample, 'norm')
        self.assertLess(p, 0.05)
Exemple #2
0
    def test_gaussian_random_with_bounds(self):
        """...Test gaussian random numbers simulation with mean and scale
        defined
        """
        mu = -10
        sigma = 0.5

        seeded_sample = \
            [-10.58093465, -10.31294449, -9.98125953, -10.34969085, -9.82447348]

        self._test_dist_with_seed(seeded_sample, test_gaussian, mu, sigma)

        # Statistical tests
        sample = test_gaussian(mu, sigma, self.stat_size, self.test_seed)
        p, _ = stats.kstest(sample, 'norm', (mu, sigma))
        self.assertLess(p, 0.05)