From c01d8d14ffaec44cf8e2c620b1cd8f5372681d20 Mon Sep 17 00:00:00 2001 From: Sambit Panda Date: Mon, 9 Dec 2019 15:05:16 -0500 Subject: [PATCH] change permutations so it is one sided --- mgc/independence/base.py | 3 +-- mgc/ksample/base.py | 4 +--- mgc/time_series/base.py | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mgc/independence/base.py b/mgc/independence/base.py index a63563318..7058d51b9 100644 --- a/mgc/independence/base.py +++ b/mgc/independence/base.py @@ -56,11 +56,10 @@ def _perm_stat(self, index): # pragma: no cover perm_stat : float Test statistic for each value in the null distribution. """ - permx = self.rngs[index].permutation(self.x) permy = self.rngs[index].permutation(self.y) # calculate permuted statics, store in null distribution - perm_stat = self._statistic(permx, permy) + perm_stat = self._statistic(self.x, permy) return perm_stat diff --git a/mgc/ksample/base.py b/mgc/ksample/base.py index 40b8e9c06..f8b503da0 100644 --- a/mgc/ksample/base.py +++ b/mgc/ksample/base.py @@ -56,12 +56,10 @@ def _perm_stat(self, index): # pragma: no cover perm_stat : float Test statistic for each value in the null distribution. """ - - permu = self.rngs[index].permutation(self.u) permv = self.rngs[index].permutation(self.v) # calculate permuted statics, store in null distribution - perm_stat = self.indep_test._statistic(permu, permv) + perm_stat = self.indep_test._statistic(self.u, permv) return perm_stat diff --git a/mgc/time_series/base.py b/mgc/time_series/base.py index 3dd494db5..eb1d758e6 100644 --- a/mgc/time_series/base.py +++ b/mgc/time_series/base.py @@ -73,11 +73,10 @@ def _perm_stat(self, index): # pragma: no cover ] ].flatten()[:n] perm_index = np.mod(perm_index, n) - permx = self.distx[np.ix_(perm_index, perm_index)] permy = self.disty[np.ix_(perm_index, perm_index)] # calculate permuted statics, store in null distribution - perm_stat = self._statistic(permx, permy) + perm_stat = self._statistic(self.distx, permy) return perm_stat