HomeStatisticsPearson Correlation & Covariance Ellipse Explorer (2D)

Pearson Correlation & Covariance Ellipse Explorer (2D)

Interactive 2D scatter-plot simulator: generate bivariate data from a chosen population correlation and watch the Pearson correlation coefficient r, covariance, the least-squares fit line, and the covariance-matrix eigen-decomposition (principal-axis confidence ellipse) update live from the real sample.

Statistics2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-data-science ↗ Open standalone

This simulator generates a synthetic bivariate dataset from a target population correlation ρ that you set, renders it as a flat 2D scatter plot, and computes the real sample statistics live: the Pearson correlation coefficient r, the covariance, the R² of a least-squares fit, and the slope of that fit line. It additionally decomposes the sample's 2×2 covariance matrix into its eigenvalues and eigenvectors and draws the resulting 1σ/2σ confidence ellipse — a genuinely 2D visualization of how "spread along a direction" relates to correlation that a rotating 3D point cloud cannot show as cleanly. Adjusting sample size shows how the measured r and the ellipse shape converge toward their population values as N grows, and adjusting spread demonstrates that r, the ellipse tilt, and its aspect ratio are all invariant to the scale of the data even though the cloud looks wider or narrower.

⚙ Under the hood

Generate a synthetic 2D scatter plot from a chosen population correlation and watch the Pearson coefficient r, covariance, R², the least-squares fit line, and the covariance-matrix eigen-decomposition (principal-axis confidence ellipse) update live from the actual sample.

statisticscorrelationdata-scienceregressionsamplingcovariance ellipseeigenvalues

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)