Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change permutations so it is one sided #39

Merged
merged 2 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
change permutations so it is one sided
  • Loading branch information
sampan501 committed Dec 9, 2019
commit c01d8d14ffaec44cf8e2c620b1cd8f5372681d20
3 changes: 1 addition & 2 deletions mgc/independence/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions mgc/ksample/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions mgc/time_series/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down