Overview
The Datasaurus Dozen Interactive Laboratory explores the critical, highly fundamental limits of classical numerical analysis. It serves as a modern, expanded homage to Anscombe's Quartet, a landmark mathematical proof presented in 1973 by statistician Francis Anscombe to demonstrate the vital necessity of visualizing raw data distributions rather than relying solely on descriptive parameters. The center of this laboratory is Alberto Cairo's famous dataset: twelve radically different spatial shapes (including a Tyrannosaurus Rex skeleton, concentric circles, lines, and stars) that yield the exact same statistical summary properties down to multiple decimal places.
In physical sciences, epidemiology, and clinical biosignal processing (such as cardiac electrocardiograms, continuous glucose monitoring, or neurological encephalography), analyzing data by its aggregate metrics alone can mask dramatic physiological shifts. If a researcher looks only at average diagnostic outputs, they may fail to realize that the underlying signal topology represents entirely different diagnostic states.
When evaluated through standard parametric equations, every shape in this interactive laboratory presents identical mathematical signatures. The statistical properties of each dataset are strictly constrained to the following targets:
- The sample mean of the horizontal coordinate is always constant: $\bar{x} \approx 54.26$
- The sample mean of the vertical coordinate is always constant: $\bar{y} \approx 47.83$
- The standard deviation of the horizontal coordinate is invariant: $\sigma_x \approx 16.76$
- The standard deviation of the vertical coordinate is invariant: \(\sigma_y \approx 26.93\)
- The Pearson product-moment correlation coefficient is static: \(r \approx -0.06\)
Relying exclusively on aggregate statistics like $\bar{x}$, $\bar{y}$, $\sigma_x$, or $\sigma_y$ when evaluating patients or complex biological structures is mathematically dangerous. Unimodal, bimodal, skewed, and highly structural patterns can produce identical summary scores, despite conveying completely different physical realities. This highlights why graphical visualization remains the ultimate safeguard in analytical diagnostics.
How to Use
This simulator acts as a high-tech diagnostic oscilloscope console. Use the following sequential controls to investigate the mathematical space:
- Active Morph Target: Swap between different geometries in the primary control panel dropdown. Points will transition using a linear morph, continuously calculating and displaying the current summary metrics during transformation. Notice how the statistics break during the drift, only to snap back to the targeted numbers once alignment is achieved.
- Plot Toggle (Box Plot / Violin Plot): Use the
📊 PLOT: button in the top monitor bar to cycle between standard Box Plots (default) and Kernel Density Violin Plots (optional) for both the $X$ and $Y$ coordinates. Watch how the distribution of points morphs dynamically while keeping their statistical parameters absolutely constant.
- Morph Speed: Calibrate how fast coordinates transition between datasets. Lower speeds show the intermediate statistical breakdown in greater detail.
- Sonar Sweep Speed: The scanning laser translates the visual coordinates into audible sound. Turn SOUND ON to hear coordinates sonified. The pitch of each chirp correlates to the coordinate's $y$ dimension, demonstrating spatial auditory mapping.
- Custom Drawn Mode: Select this preset and draw directly on the canvas. The engine takes your drawing (shown in low-contrast red) and applies a real-time Gram-Schmidt-based spatial transformation to align the coordinates (shown in glowing neon) with the target statistics perfectly.
To observe the statistical breakdown in real-time, select a slow Morph Speed and switch between datasets. During the morph, the intermediate frames deviate from the static goals, illustrating the transition path between identical statistical states.
Technical Details
The alignment engine uses a multi-step linear algebraic projection to transform any raw coordinate set \(\mathbf{P} = \{x_i, y_i\}_{i=1}^N\) to match target statistical moments.
First, we calculate the sample means and construct centered coordinates:
$$x'_i = x_i - \bar{x}, \quad y'_i = y_i - \bar{y}$$
Next, we evaluate the sample variances and the sample covariance:
$$s_{xx} = \frac{1}{N}\sum x'^2_i, \quad s_{yy} = \frac{1}{N}\sum y'^2_i, \quad s_{xy} = \frac{1}{N}\sum x'_i y'_i$$
We then apply a Gram-Schmidt orthogonalization to construct an uncorrelated orthogonal basis:
$$y'' = y' - \frac{s_{xy}}{s_{xx}} x'$$
We normalize the vectors to unit variance:
$$\tilde{x}_i = \frac{x'_i}{\sqrt{s_{xx}}}, \quad \tilde{y}_i = \frac{y''_i}{\sqrt{\text{Var}(y'')}}$$
To introduce our precise targeted correlation coefficient \(R \approx -0.06\), we scale using a Cholesky-style projection:
$$\tilde{u}_i = \tilde{x}_i$$
$$\tilde{v}_i = R \tilde{x}_i + \sqrt{1 - R^2} \tilde{y}_i$$
Finally, we scale and translate these standardized points to match the canonical Datasaurus statistics (\(M_x, M_y, \sigma_x, \sigma_y\)):
$$u_i = M_x + \sigma_x \tilde{u}_i, \quad v_i = M_y + \sigma_y \tilde{v}_i$$
To compute the Violin Plot densities, we employ a non-parametric Kernel Density Estimation (KDE) with a Gaussian kernel:
$$f(t) = \frac{1}{N \cdot h} \sum_{i=1}^N \frac{1}{\sqrt{2\pi}} \exp\left(-\frac{(t - w_i)^2}{2h^2}\right)$$
where \(w_i\) represents the coordinate values, and the bandwidth parameter is set to \(h_x = 4.0\) and \(h_y = 6.0\). This produces smooth, continuous envelopes reflecting the real-time probability density functions of both axes.
The application is engineered with high-performance 2D Canvas contexts. High-DPI screen adjustments are calculated based on window.devicePixelRatio to prevent blurry scaling artifacts on retina displays or high-resolution monitors.
Future Directions
Upcoming updates to the platform will expand its diagnostic capabilities with the following advanced modules:
- Heuristic Optimization Workers: Integrating Web Worker-threaded genetic algorithms and simulated annealing solvers to generate user-defined configurations using continuous mathematical curves.
- 3D Statistical Projection: Expanding coordinates into a three-dimensional Euclidean vector space with multi-axis marginal distribution graphs, analyzing multivariate correlation tensors.
- Biosignal Simulation Templates: Demonstrating how identical standard power-spectral densities (PSDs) can hide underlying abnormalities in biological rhythms.
- Arbitrary Target Statistical Tuning: Allowing users to input their own custom target mean, standard deviation, and correlation parameters to test the robust mathematical bounds of coordinate projection algorithms.
These features aim to bridge the gap between abstract mathematical alignment and clinical pathology exploration, giving researchers a modular sandbox to investigate how biological systems mask diagnostic anomalies beneath normal aggregate profiles.