Skip to content

Commit

Permalink
minor change to setting that decides when to use exact vs approx perm…
Browse files Browse the repository at this point in the history
…utations
  • Loading branch information
acp29 committed May 2, 2024
1 parent 1fef1c1 commit af4f4cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inst/randtest.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
end

% Create permutations or randomized samples
if (factorial (n) < nreps)
if (factorial (n) <= nreps)
I = perms (1:n).'; % For exact (permutation) test
nreps = factorial (n);
else
Expand Down
4 changes: 2 additions & 2 deletions inst/randtest2.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
gz = cat (1, gx, gy);

% Create permutations or randomized samples
if (factorial (nz) < nreps)
if (factorial (nz) <= nreps)
I = perms (1:nz).'; % For exact (permutation) test
nreps = factorial (nz);
else
Expand Down Expand Up @@ -324,7 +324,7 @@
mat2cell (y(:, 1), accumarray (gy, 1))');

% Create permutations or perform randomization
if (2^nz < nreps)
if (2^nz <= nreps)
I = (dec2bin (0 : 2^nz - 1).' - '0') + 1; % For exact (permutation) test
nreps = 2^nz;
else
Expand Down

0 comments on commit af4f4cd

Please sign in to comment.