Mahalanobis Distance
✓ Published0🌍 Public
EEfratVil
Last edited Oct 3, 2017
Created on Oct 3, 2017
A slider adjusts the correlation level between two variables, and the scatter plot updates to show how the Mahalanobis distance of each point changes accordingly. The visualization encodes distance through color, transitioning from green for low distances to red for high ones, overlaid on 2,000 points sampled from a bivariate normal distribution. The code uses D3 v4 to render an SVG with axes and circles, while the Mahalanobis distance is computed via a custom Cholesky decomposition and matrix operations, with colors interpolated using a linear scale with HCL color space.
AI-generated descriptionScatter plot with color coding according to Mahalanobis distance. <br/>
Created based on @veltman's block, and <br/>calculating bi-variate normal