Mutual Information Lab (2D)
2D binned joint-distribution heatmap and scatter plot comparing Pearson correlation against mutual information as the relationship between two variables changes shape.
This 2D companion drives the same binned mutual-information estimator as the 3D version through a plain canvas view built for reading the numbers rather than orbiting a scene: a side panel lets you pick between linear, quadratic, sine, circular and independent relationships, dial in noise and sample size, and switch between a density heatmap, a scatter plot, or both overlaid. Pearson r and mutual information update live underneath, so you can watch correlation collapse to near zero for the circular and quadratic cases while mutual information — computed straight from the 2D histogram bins — stays high, and watch both drop toward a shuffled baseline once "Shuffle Y" destroys the dependence.
2D binned joint-distribution heatmap and scatter plot comparing Pearson correlation against mutual information as the relationship between two variables changes shape.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
Pearson correlation only measures the strength of a straight-line trend. A quadratic curve or a circular relationship can be a perfectly deterministic dependency with a correlation near zero, because there is no consistent linear direction to detect.
Mutual information measures how much knowing one variable reduces uncertainty about the other, regardless of the shape of the relationship. It is estimated here from a binned joint histogram and stays high for nonlinear and circular dependencies where correlation collapses to zero.
Shuffling y randomly permutes the y-values while keeping both marginal distributions identical, which destroys any dependence between x and y. Mutual information collapses toward its shuffled baseline even though neither variable's individual distribution changes.