def test_n_exp_mat_sum_trial_surrogate(self): mat = self.binary_sts pattern_hash = np.array([5]) N = 3 n_exp_anal = ue.n_exp_mat_sum_trial(mat, N, pattern_hash, method='analytic_TrialAverage') n_exp_surr = ue.n_exp_mat_sum_trial(mat, N, pattern_hash, method='surrogate_TrialByTrial',n_surr = 1000) self.assertLess((np.abs(n_exp_anal[0]-np.mean(n_exp_surr))/n_exp_anal[0]),0.1)
def test_n_exp_mat_sum_trial_TrialAverage(self): mat = self.binary_sts pattern_hash = np.array([5, 6]) expected = np.array([1.62, 2.52]) n_exp = ue.n_exp_mat_sum_trial( mat, pattern_hash, method='analytic_TrialAverage') self.assertTrue(np.allclose(n_exp, expected))
def test_n_exp_mat_sum_trial_default(self): mat = self.binary_sts pattern_hash = np.array([5, 6]) N = 3 expected = np.array([1.56, 2.56]) n_exp = ue.n_exp_mat_sum_trial(mat, N, pattern_hash) self.assertTrue(np.allclose(n_exp, expected))
def test_n_exp_mat_sum_trial_TrialAverage(self): mat = self.binary_sts pattern_hash = np.array([5,6]) N = 3 expected = np.array([ 1.62, 2.52]) n_exp = ue.n_exp_mat_sum_trial(mat, N, pattern_hash, method='analytic_TrialAverage') self.assertTrue(np.allclose(n_exp,expected))
def test_n_exp_mat_sum_trial_default(self): mat = self.binary_sts pattern_hash = np.array([5,6]) N = 3 expected = np.array([ 1.56, 2.56]) n_exp = ue.n_exp_mat_sum_trial(mat, N,pattern_hash) self.assertTrue(np.allclose(n_exp,expected))