The maximal information coefficient searches over 2-D grids for the one that reveals the most mutual information, normalized so that the result lies in . Implement a simplified MIC that uses equal-frequency grids only (no optimization of the bin boundaries):
mic(x, y, alpha=0.6) for two 1-D samples of equal size :
(mic, k_best, l_best): the maximum entry and the grid size where it occurs, scanning ascending in the outer loop and ascending in the inner loop; a later grid replaces the current best only if its score is larger by more than (so near-ties keep the earlier grid). Return mic as a float and the sizes as ints.If no grid satisfies the constraint, return (0.0, 0, 0).