def test_copies(self): x = np.random.uniform(low=0, high=1, size=(2, 100)) x0 = np.copy(x[0]) x1 = np.copy(x[1]) entropy.sampen(x0, 2, 0.1) assert_equal(x0, x[0]) entropy.fuzzyen(x0, 2, 0.1, 2) assert_equal(x0, x[0]) entropy.cross_sampen(x0, x1, 2, 0.1) assert_equal(x0, x[0]) assert_equal(x1, x[1]) entropy.cross_fuzzyen(x0, x1, 2, 0.1, 2) assert_equal(x0, x[0]) assert_equal(x1, x[1])
def test_sampen_1d(self): e = entropy.sampen(self.data_1d, 2, 0.1) assert_almost_equal(e, 0.70589052)