Dear John,
I saw that you use the Miller-Rabin algorithm to test primality. considering that are known the strong pseudoprimes to the first 9 prime bases (http://arxiv.org/pdf/1207.0063.pdf), I suggest a little implementation to speed up your Miller-Rabin algorithm:
MyFisher23
A very compact routine for Fisher's exact test on 2x3 contingency table
Author: Giuseppe Cardillo
For negative values, gammaln would return INF so that table is not added to computation. Maybe in previous version of gammaln this is not allowed and it calls error. So rows in Tables matrix with negative values must be erased before to give it to gammaln.
[I J]=find(Tables<0); Tables(I,:)=[];
will do this
03 Apr 2014
MyFisher23
A very compact routine for Fisher's exact test on 2x3 contingency table
Author: Giuseppe Cardillo
try to add this line before line 108
[I ~]=find(Tables<0); Tables(I,:)=[];
03 Apr 2014
MyFisher23
A very compact routine for Fisher's exact test on 2x3 contingency table
Author: Giuseppe Cardillo
I checked but on my pc the version is the same and the result is
For negative values, gammaln would return INF so that table is not added to computation. Maybe in previous version of gammaln this is not allowed and it calls error. So rows in Tables matrix with negative values must be erased before to give it to gammaln.
[I J]=find(Tables<0); Tables(I,:)=[];
will do this
03 Apr 2014
MyFisher23
A very compact routine for Fisher's exact test on 2x3 contingency table
Author: Giuseppe Cardillo
Nice. One issue with the verbose option: when set to 0, it doesnt fill the .co part of the output anymore. To fix, switch the lines
m=[table(CSe,1) table(CSp,1) CE table(CEff,1)];
end
near the end of the code (line 300 or so)
For negative values, gammaln would return INF so that table is not added to computation. Maybe in previous version of gammaln this is not allowed and it calls error. So rows in Tables matrix with negative values must be erased before to give it to gammaln.
[I J]=find(Tables<0); Tables(I,:)=[];
will do this
Comment only
03 Apr 2014
MyFisher23
A very compact routine for Fisher's exact test on 2x3 contingency table
Comment only