This 2D companion plots the exact same bivariate sample the 3D version does — the underlying data was always two numbers per point, so a flat scatter plot is the honest native view of it (the 3D scene only added a cosmetic depth jitter to spread the cloud visually). What's genuinely new here is drawing the covariance-matrix eigen-decomposition directly as a confidence ellipse, something a rotating 3D cloud cannot show cleanly:
Σ = | var(X) cov(X,Y) |
| cov(X,Y) var(Y) |
λ₁,₂ = (tr(Σ) ± √[(varX−varY)² + 4·cov²]) / 2
θ = ½·atan2(2·cov, varX−varY) (principal-axis angle)
The ellipse's two semi-axes have length k·√λ₁ and k·√λ₂ (k=1 draws the 1σ ellipse, k=2 the 2σ ellipse) and are oriented along θ and θ+90°. A near-circular ellipse means the two eigenvalues are close — the cloud has no preferred direction, matching r near 0. A thin, tilted ellipse means one eigenvalue dominates — most of the joint variance lives along a single direction, which is exactly what a strong linear correlation looks like geometrically.
- Correlation strength ρ — the population correlation used to generate the synthetic sample (via a Cholesky-style linear mix of two independent standard-normal variables). The measured sample r hovers near ρ but never matches it exactly — that sampling noise is the point.
- Sample size N — more points make the measured r (and the ellipse shape) converge tighter around the population values, illustrating why small samples give unreliable correlation estimates.
- Spread (σ) — scales the variance of both variables; it changes the ellipse's absolute size but not its shape, tilt, or r itself, since r is scale-invariant.
- Fit line — the ordinary-least-squares line ŷ = a + bx minimizing Σ(yᵢ−ŷᵢ)²; its slope b = r·(σy/σx). It always lies inside the ellipse but is not the same as the ellipse's major axis unless σx = σy.
Correlation is not causation: this simulator only ever shows two variables moving together by construction — it says nothing about what would happen if you intervened on one of them.