Graphing • 2D Kernel Density Estimation & Marching Squares

Scatterplot with Density Contours Calculator

Eliminate overplotting in dense point distributions. Compute smooth two-dimensional Gaussian Kernel Density Estimation (2D KDE), extract vector isodensity contour isolines via Marching Squares, detect multimodal distribution peaks, and explore highest density regions (HDR) with real-time interactive coordinate dragging.

Curated Bivariate Density Archetypes Click to load distribution preset
2D Density Topography Canvas 0 observations
X: 0.00, Y: 0.00 | f̂: 0.0000
Density (f̂) Peak
Low (10%) 50% Max (Peak)
Interactive Topography: Click anywhere on the Cartesian canvas to plant new observations. Drag existing points to observe instantaneous real-time recalculation of continuous 2D KDE contour isolines.

2D KDE & Contour Settings

Gaussian Kernel
1.00× (Silverman)
0.2× (Undersmoothed) 1.0× (Optimal Rule) 2.5× (Oversmoothed)

Distribution & Modality Analytics

Primary Peak Mode (X, Y) —
Max Density Amplitude —
Bandwidths (h_x, h_y) —
Pearson Correlation (r) —
Fitted Regression & Modality
y = 0.0000x + 0.0000
Modality: Evaluating topology...

Observation Data Coordinates

Add, delete, or bulk-paste (X, Y) observation coordinate pairs
# X Coordinate Y Coordinate Local Density (f̂) Action
Direct Answer & Overview
Verified Educational Guide

A scatterplot with density contours solves Cartesian marker overplotting by fitting a continuous two-dimensional Gaussian Kernel Density Estimation (2D KDE) surface over discrete observations and extracting vector isodensity isolines using the Marching Squares algorithm. Each observation contributes a smooth Gaussian probability bell; their constructive interference creates an elevated probability terrain where contour isolines trace lines of equal probability density. This reveals hidden multimodal cluster centers, ridge trajectories, and relative probabilistic mass without discarding individual data points.

1. Foundations of Bivariate Density Contours & Overplotting Solutions

In exploratory data analysis, the two-dimensional Cartesian scatterplot is the undisputed gold standard for investigating relationships between pairs of continuous numerical variables. However, standard point scatter suffers from a catastrophic visual limitation known as overplotting. When sample sizes expand from dozens of observations into hundreds, thousands, or tens of thousands, marker points plotted at identical or nearby spatial coordinates overlap into a completely opaque, saturated solid mass.

In an overplotted scatterplot, visual information regarding relative sample frequency is entirely lost. A single isolated pixel on the canvas may represent one lone outlier or a thousand identical points stacked directly on top of one another. The analyst cannot discern whether a dense cluster contains 10% or 80% of the sample mass, nor can they detect whether an apparent single cluster actually harbors multiple internal local modes, non-linear curvilinear ridges, or hollow rings.

Density contours resolve this fundamental crisis by treating the discrete point sample as an empirical draw from an underlying continuous bivariate probability density function f(x, y). By overlaying continuous topological isolines—curves connecting coordinates of identical estimated probability density—the visualization transforms a confusing flat 2D point cloud into an interpretable three-dimensional probability terrain viewed from above. Dense clusters become steep probability mountains, multimodal groupings emerge as distinct mountain peaks, and low-density regions appear as sweeping valleys.

2. Mathematical Formulation of 2D Gaussian Kernel Density Estimation

Kernel Density Estimation (KDE) is a non-parametric method for estimating the probability density function of a random variable without imposing rigid parametric assumptions (such as forcing the data to follow a global bivariate normal distribution). Given an empirical bivariate dataset of n observations {(x1, y1), (x2, y2), …, (xn, yn)}, the estimated continuous density surface f̂(x, y) evaluated at any arbitrary point (x, y) ∈ ℝ^2 is formally defined as:

f̂(x, y) = (1) / (n) ∑ K_{H}( x - x_i \\ y - y_i )

where K_{H} represents a bivariate smoothing kernel parameterized by a symmetric, positive-definite 2 × 2 bandwidth covariance matrix H. In standard practical implementations, kernels are assumed to be independent along Cartesian axes, simplifying H to a diagonal matrix diag(h_x^2, h_y^2).

Under the standard bivariate Gaussian (normal) kernel, each observation acts as the mean center of an infinitesimal bell-shaped probability hill. The analytical formulation expands to:

f̂(x, y) = (1) / (2π n h_x h_y) ∑ exp(-(1) / (2)[((x - x_i) / (h_x))^2 + ((y - y_i) / (h_y))^2])

This mathematical formulation satisfies all requisite axioms of a valid probability density function:

  • Non-negativity: f̂(x, y) ≥ 0 for all (x, y) ∈ ℝ^2, guaranteed because exponential functions are strictly positive.
  • Total Probability Conservation: The double integral across the infinite plane equals exactly unity: ∬_{ℝ^2} f̂(x, y) dx dy = 1.
  • Smooth Differentiability: Because the Gaussian kernel is infinitely differentiable (C^∈fty), the resulting density surface possesses continuous partial derivatives of all orders, guaranteeing smooth, aesthetic isolines.

3. Bandwidth Selection: Silverman's Rule, Scott's Rule & Bias-Variance Balance

While the choice of kernel shape (Gaussian, Epanechnikov, Quartic, or Uniform) exerts negligible influence on the final topological reconstruction, the choice of the smoothing bandwidth (h_x, h_y) is profoundly critical. Bandwidth serves as the spatial variance of the kernel, dictating the distance over which individual observations cast their probabilistic influence.

Undersmoothing (h \to 0): High Variance

When bandwidth is chosen too narrow, individual kernel bells fail to overlap constructively. The resulting density surface fractures into needle-like spikes directly above sampled coordinates surrounded by barren zero-density moats. Isolines degenerate into tiny concentric circles around single data points, obscuring macro trends and amplifying random sampling noise.

Oversmoothing (h \to ∈fty): High Bias

When bandwidth is set too wide, Gaussian distributions spread far beyond their empirical locality. The estimator blurs distinct multimodal clusters into a single amorphous unimodal oval, inflating the variance of the distribution, depressing peak density heights, and obliterating subtle non-linear topological features like ridges and saddle points.

Parametric Optimal Bandwidth: Silverman's Rule of Thumb

To eliminate manual guesswork, this tool implements Silverman's Asymptotic Rule of Thumb generalized to bivariate Gaussian kernels. Under the theoretical assumption that the true underlying distribution approximates a normal distribution with sample standard deviations s_x and s_y, the bandwidths that minimize Asymptotic Mean Integrated Squared Error (AMISE) are:

h_x = 1.06 · s_x · n^{-1/5}, h_y = 1.06 · s_y · n^{-1/5}

For robust resistance against extreme numerical outliers, s_x can be substituted with the normalized Interquartile Range IQR_x / 1.349, yielding:

h_x = 0.9 · min(s_x, (IQR_x) / (1.349)) · n^{-1/5}

Our tool dynamically evaluates Silverman's Rule while providing an interactive Bandwidth Multiplier (\gamma) slider (0.2× to 3.0×). This gives you total exploratory control to inspect fine multimodal microstructures or enforce broad macro-generalization on demand.

4. Marching Squares Algorithm & Isoline Vector Extraction Mechanics

Once the continuous 2D KDE surface f̂(x, y) is established, we must extract discrete vector isolines corresponding to specified density thresholds c. An isodensity contour is the mathematical locus of coordinates satisfying the implicit equation:

C_c = ≤ft&lbrace (x, y) ∈ ℝ^2 \middle| f̂(x, y) = c \right&rbrace

In computer graphics and computational geometry, this is solved with high numerical efficiency using the Marching Squares algorithm—the 2D analogue of the 3D Marching Cubes algorithm.

Algorithmic Execution Pipeline:

  1. Grid Discretization: The spatial bounding box [X_{min}, X_{max}] × [Y_{min}, Y_{max}] is tessellated into a uniform grid of M × N cells (in our calculator, an optimized 60 × 60 = 3,600 cell mesh). The density function f̂ is evaluated at every grid intersection (x_j, y_k).
  2. Cell Vertex Binarization: For each rectangular cell composed of four corner vertices—Top-Left (V_{TL}), Top-Right (V_{TR}), Bottom-Right (V_{BR}), and Bottom-Left (V_{BL})—each vertex is assigned a binary state depending on whether its scalar density meets or exceeds threshold c: state(V) = 1 & if f(V) ≥ c \\ 0 & if f(V) \lt c
  3. Case Lookup Table (0 through 15): Combining the four binary bits yields an integer index from 0 to 15 (V_{TL} · 8 + V_{TR} · 4 + V_{BR} · 2 + V_{BL} · 1). An index of 0 means all corners lie below c (no contour lines pass through the cell); an index of 15 means all corners lie above c (interior of the contour, no boundary lines). The remaining 14 topological cases dictate exactly how contour line segments traverse the four cell edges.
  4. Linear Boundary Interpolation: Rather than anchoring contour segments at edge midpoints, linear interpolation computes the exact zero-crossing point along cell edges. For an edge connecting vertex A (density f_A) and vertex B (density f_B), the interpolated coordinate is: P = A + ((c - f_A) / (f_B - f_A))(B - A) This guarantees mathematically smooth, continuous contour curves without jagged staircase artifacts.
  5. Ambiguity Resolution (Saddle Cases 5 and 10): When diagonally opposing corners are above the threshold while adjacent corners are below (Cases 5 and 10), topological ambiguity arises. Our engine evaluates the average density at the cell centroid f_{center} = (1) / (4)(f_{TL} + f_{TR} + f_{BR} + f_{BL}) to determine whether isolines connect horizontally or vertically, preventing topological self-intersections.

5. Highest Density Regions (HDR) & Probabilistic Contour Percentiles

When viewing density contours, a common question arises: What fraction of the total population or sample mass is enclosed within each contour ring?

In probability theory, this is formalized through the concept of Highest Density Regions (HDR), pioneered by statistician Rob J. Hyndman. For a given coverage probability 1 - α ∈ (0, 1) (such as 50%, 75%, or 95%), the 100(1 - α)\% HDR is defined as:

R_α = ≤ft&lbrace (x, y) ∈ ℝ^2 \middle| f̂(x, y) ≥ f_α \right&rbrace

where the threshold density f_α is the largest scalar constant such that:

∬_{R_α} f̂(x, y) dx dy = 1 - α

Mathematical Properties of HDR:

  • Minimum Spatial Area: Among all possible 2D spatial regions S \subset ℝ^2 that enclose a probability mass of 1 - α, the HDR R_α possesses the minimum total geometric surface area. It represents the most tightly packed geographic envelope of probability.
  • Uniform Boundary Density: Every point residing on the bounding perimeter of R_α exhibits exactly the same probability density f_α.
  • Topological Flexibility: Unlike elliptical confidence regions derived from parametric Gaussian models, HDRs are not constrained to convex shapes. If the empirical distribution is bimodal or shaped like a crescent, the 50\% HDR will naturally partition into two separate closed disjoint islands.

6. Multimodal Topography, Ridge Lines & Local Extrema Peak Detection

One of the greatest analytical powers of 2D density contours is the automated discovery of multimodality. Standard univariate summary statistics (such as sample mean \bar{x}, \bar{y} and correlation coefficient r) compress data into single numbers, masking internal subgroup structure.

Consider the classic Old Faithful Geyser dataset included in our presets. An unweighted linear regression line suggests an overall positive correlation between eruption duration and waiting time. However, the density contour map instantly reveals that data points do not form a single homogeneous cloud; they concentrate into two sharply defined, isolated clusters:

  1. Short Eruptions: Duration ≈ 2.0 minutes, Waiting Time ≈ 54 minutes.
  2. Long Eruptions: Duration ≈ 4.4 minutes, Waiting Time ≈ 80 minutes.

In our tool, an automated Local Extrema Peak Detection algorithm scans the evaluated 60 × 60 density scalar grid. A grid vertex (x_j, y_k) is classified as a local mode if its density exceeds all 8 adjacent neighborhood grid vertices:

f(x_j, y_k) \gt f(x_{j + δ x}, y_{k + δ y}) ∀ δ x, δ y ∈ \{-1, 0, 1\} \ \{(0, 0)\}

The tool overlays distinct diamond markers and precise coordinate labels directly onto the canvas, pinpointing the exact coordinates of cluster peaks across your multivariate landscape.

7. Comparative Paradigm: 2D KDE Contours vs. Hexagonal Bins vs. 2D Histograms

When confronting massive 2D datasets, analysts can choose between three primary density aggregation techniques: rectangular 2D histograms, hexagonal binning (hexbins), and continuous 2D Kernel Density Estimation with contours. Understanding the architectural strengths and weaknesses of each paradigm ensures rigorous visualization design.

Feature Dimension 2D Rectangular Histogram Hexagonal Binning (Hexbin) 2D KDE with Density Contours
Continuity & Smoothness Piecewise constant, blocky, highly discontinuous Piecewise constant, tessellated honeycomb cells Smooth, continuously differentiable (C^∈fty) topological surface
Origin / Edge Sensitivity Severe: shifting grid origins changes bin counts substantially Moderate: hexagonal symmetry reduces directional bias Zero grid edge artifacting; invariant to coordinate origin translation
Point Preservation Points aggregated and discarded; individual markers hidden Points aggregated and discarded; individual markers hidden Simultaneous overlay: vector contours float above visible raw points
Computational Complexity \mathcal{O}(n) — Extremely fast single pass \mathcal{O}(n) — Fast centroid distance binning \mathcal{O}(n · M · N) — Evaluated across discrete scalar grid
Best Use Case Quick exploratory summaries of massive raw logs Million-row scatterplots requiring strict counts per area unit Scientific publishing, cluster mode discovery, publication-grade figures

8. Step-by-Step Practical Workflow for Contour Plot Generation

Generating publication-ready scatterplots with density contours requires following a disciplined four-stage analytical protocol:

Step 1: Data Normalization & Coordinate Range Audit

Inspect raw data dimensions for vast scale discrepancies. If variable X spans [0, 1] while variable Y spans [10^5, 10^7], evaluate independent standard deviations s_x, s_y to calibrate anisotropic bandwidths h_x, h_y separately for each axis.

Step 2: Bandwidth Calibration via Silverman's Baseline

Compute baseline Silverman bandwidths h_x = 1.06 · s_x · n^{-1/5}. Adjust the bandwidth multiplier slider: decrease to 0.5× - 0.7× if you suspect fine, localized subclusters, or increase to 1.2× - 1.5× if sparse outliers induce artificial noisy contour pockets.

Step 3: Contour Level Partitioning & Display Mode Selection

Select the number of contour levels (typically 6 to 10). Toggle between:

  • Filled Bands + Lines: Provides maximum visual punch by color-coding discrete density bands according to perceptual colormaps like Viridis or Magma.
  • Wireframe Lines Only: Ideal when individual scatter points must remain maximally crisp and readable without color occlusion.
  • Continuous Surface Heatmap: Renders a smooth, bilinear raster heat gradient under the scatter plot.
Step 4: Interactive Verification & Vector SVG Export

Drag individual points on the canvas to observe real-time topology recalculation. Verify that peak mode markers correspond to intuitive density hubs, then export crisp vector SVGs for LaTeX/academic papers or high-resolution PNGs for executive slide decks.

9. Comparative Visualization Matrix for Bivariate Density Methods

Select the appropriate visualization based on sample size, cluster complexity, and analytical goals:

Alpha-Transparent Scatter

Sample Size: 50 to 1,000 points.
Best For: Simple point cloud inspection where density differences are mild.
Limitation: Alpha saturation quickly turns into opaque black blobs beyond 1,000 overlapping markers.

2D KDE Contours (This Calculator)

Sample Size: 20 to 50,000 points.
Best For: Complex multimodal distributions, cluster boundary demarcation, publication figures.
Strength: Retains raw point visibility while displaying mathematically rigorous probability topography.

Marginal Histogram Scatter

Sample Size: 50 to 5,000 points.
Best For: Inspecting 1D marginal distributions along X and Y axes independently.
Limitation: Cannot reveal 2D interactive correlations or oblique bivariate ridge structures.

10. Graded Worked Problems with Complete Analytical Solutions

Problem 1: Exact Analytical Evaluation of Bivariate Gaussian Density

Intermediate

Consider a minimal bivariate dataset consisting of two observations: P_1 = (2, 4) and P_2 = (6, 4). Using isotropic Gaussian kernels with bandwidth h_x = h_y = 2.0, calculate the exact estimated continuous density f̂(x, y) at the midpoint coordinate (4, 4) and at the sample point (2, 4).

Complete Step-by-Step Analytical Derivation:

1. General 2D KDE Equation with n = 2 and h_x = h_y = 2:

f̂(x, y) = (1) / (2π · 2 · 2 · 2) ∑ exp(-(1) / (2)[((x - x_i) / (2))^2 + ((y - y_i) / (2))^2]) = (1) / (16π) ∑ exp(-(d_i^2) / (8))

where d_i^2 = (x - x_i)^2 + (y - y_i)^2 is squared Euclidean distance.

2. Density at Midpoint (4, 4):

Distance to P_1(2, 4): d_1^2 = (4 - 2)^2 + (4 - 4)^2 = 4 + 0 = 4.

Distance to P_2(6, 4): d_2^2 = (4 - 6)^2 + (4 - 4)^2 = 4 + 0 = 4.

f̂(4, 4) = (1) / (16π)[exp(-(4) / (8)) + exp(-(4) / (8))] = \frac{2 · e^{-0.5}}{16π} = \frac{e^{-0.5}}{8π} ≈ (0.60653) / (25.1327) ≈ \mathbf{0.02413}

3. Density at Sample Point (2, 4):

Distance to P_1(2, 4): d_1^2 = 0. Kernel height = e^0 = 1.0.

Distance to P_2(6, 4): d_2^2 = (2 - 6)^2 + 0 = 16. Kernel height = e^{-16/8} = e^{-2} ≈ 0.13534.

f̂(2, 4) = (1) / (16π)[1.0 + 0.13534] = (1.13534) / (50.2655) ≈ \mathbf{0.02259}

Conclusion: Because the two points are separated by \Delta x = 4 = 2h, their kernels constructively overlap at the midpoint, creating a unified saddle mode where f̂(4, 4) > f̂(2, 4).

Problem 2: Linear Edge Interpolation in Marching Squares

Advanced Geometry

A Marching Squares grid cell has bottom-left vertex A = (10, 20) with density f_A = 0.012, and bottom-right vertex B = (15, 20) with density f_B = 0.048. If we want to extract the contour isoline at threshold c = 0.030, find the exact Cartesian coordinates (x^*, y^*) where the isoline crosses this horizontal bottom cell edge.

Complete Step-by-Step Analytical Derivation:

1. Verify That Isoline Crosses Edge AB:

Because f_A = 0.012 < c = 0.030 and f_B = 0.048 > c = 0.030, the density function crosses c along segment AB.

2. Apply 1D Linear Interpolation Formula:

The interpolation fraction t ∈ [0, 1] represents the proportional distance from A to B:

t = (c - f_A) / (f_B - f_A) = (0.030 - 0.012) / (0.048 - 0.012) = (0.018) / (0.036) = 0.500

3. Calculate Cartesian Coordinates:

x^* = x_A + t · (x_B - x_A) = 10 + 0.500 · (15 - 10) = 10 + 2.5 = \mathbf{12.5}

y^* = y_A = y_B = \mathbf{20.0}

Result: The contour isoline intersects the bottom cell edge at exactly (12.5, 20.0).

11. Cross-Disciplinary Applications in Volcanology, Astronomy, Econometrics & Genomics

Bivariate density contours are critical across numerous scientific and engineering fields:

Astronomical Hertzsprung-Russell Diagrams

When cataloging hundreds of thousands of stellar observations from the Gaia satellite space mission, plotting stellar surface temperature versus absolute luminosity yields immense point saturation. Density contours trace the exact ridge trajectory of the Main Sequence, Red Giant branch, and White Dwarf cooling track, enabling astrophysicists to model stellar evolutionary lifespans.

Flow Cytometry & Single-Cell Genomics

Immunologists analyze millions of blood cells sorted by fluorescence-activated cell sorting (FACS), plotting forward scatter (FSC, cell size) against side scatter (SSC, internal granularity). 2D density contours establish objective gating boundaries that isolate distinct lymphocyte, monocyte, and granulocyte subpopulations.

Quantitative Finance & Portfolio VaR

In asset management, plotting daily returns of equity pairs reveals fat-tailed bivariate joint distributions. Non-parametric density contours demarcate asymmetric joint tail risk and negative co-skewness that standard bivariate normal correlation coefficients fail to capture.

Geophysics & Seismological Hazard Mapping

Earthquake hypocenter coordinates (epicenter distance vs. focal depth) exhibit complex tectonic plate subduction geometries. 2D KDE contour maps outline the Benioff zone fault plane without requiring arbitrary spatial bin discretization.

12. Diagnostic Pitfalls: Boundary Truncation, Oversmoothing & False Peaks

Be vigilant against three recurring methodological errors when authoring density contour plots:

Pitfall 1: Boundary Bias (Edge Leakage)

Standard Gaussian kernels have infinite spatial support (ℝ^2). When analyzing physical variables constrained by hard theoretical boundaries (such as percentages [0, 100]\% or positive quantities X ≥ 0), Gaussian probability mass artificially "leaks" past the zero barrier, depressing peak densities near the edges. Counteract this with log-transforms or mirror reflection boundary corrections.

Pitfall 2: False Mode Hallucination from Undersmoothing

When working with small sample sizes (n < 30), choosing an excessively small bandwidth multiplier (h < 0.5 · h_{\text{silverman}}) causes single chance pairs of nearby observations to form separate closed contour islands. Always confirm multimodal peaks by increasing sample size or testing mode significance with Dip tests.

Pitfall 3: Discarding the Raw Scatter Points

Displaying filled density contours while hiding raw scatter points conceals crucial empirical outliers that reside outside the outermost contour envelope. Our tool always maintains scatter points (with customizable size and opacity) so readers can visually verify contour bounds against raw empirical observations.

13. Connected Graphing & Statistical Analysis Ecosystem Hub

Combine this bivariate density calculator with other flagship calculators across the Basic Math Tools ecosystem:

Frequently Asked Questions

What is a scatterplot with density contours and why is it used?
A scatterplot with density contours is a bivariate statistical visualization that superimposes continuous probability density isolines (isodensity contours) over a 2D Cartesian point scatter. In datasets with hundreds or tens of thousands of observations, raw scatter markers collide and saturate into an undifferentiated solid blob (overplotting). Density contours apply two-dimensional Kernel Density Estimation (2D KDE) and the Marching Squares algorithm to reveal the underlying probability topography, identifying hidden cluster cores, multimodality, ridge trajectories, and relative sparse valleys.
How does 2D Bivariate Kernel Density Estimation (2D KDE) work mathematically?
2D KDE places an identical two-dimensional smooth bell-shaped probability density function (typically an isotropic or anisotropic Gaussian kernel) over every individual observation (x_i, y_i). The collective estimated density f̂(x, y) at any arbitrary coordinate on the continuous plane is calculated by summing the contributions from all n Gaussian kernels and dividing by n times the product of bandwidths (h_x · h_y). This produces a smooth, differentiable scalar surface representing continuous probability density across the domain.
What is the bandwidth parameter and how does it influence contour geometry?
Bandwidth (h_x, h_y) controls the standard deviation (spatial dispersion) of each bivariate Gaussian kernel. It functions as the smoothing parameter in KDE. If bandwidth is set too small (undersmoothing), the density surface exhibits high variance, fracturing into jagged, noisy spikes centered on individual points. If bandwidth is set too large (oversmoothing), the estimator incurs severe bias, washing out genuine bimodal cluster separations into an artificial single blur. Silverman’s Rule of Thumb provides an optimal parametric baseline balancing this bias-variance tradeoff.
How does the Marching Squares algorithm construct vector contour lines?
Marching Squares divides the continuous 2D coordinate plane into a discrete grid of rectangular cells and evaluates the continuous density function f̂(x, y) at every grid vertex. For any chosen density threshold c, each vertex is classified as above (1) or below (0) the threshold, producing one of 16 (2⁴) binary topological configurations. The algorithm linearly interpolates along the cell edges to find the exact zero-crossing coordinates and connects them with straight line segments, stitching together smooth closed isoloops across adjacent grid cells.
What is the difference between density contours, hexbins, and 2D histograms?
2D histograms and hexagonal binning (hexbins) discretize the continuous plane into rigid, disjoint geometric cells (squares or hexagons) and count points within each bin. Their resulting visual boundaries depend heavily on arbitrary bin origin shifts and bin edge alignments. In contrast, 2D KDE produces a continuous, differentiable probability density surface independent of fixed grid borders. Overlaying vector contours directly onto scatter points preserves individual outlier inspection while simultaneously illuminating continuous probabilistic topography.
What are Highest Density Regions (HDR) in contour plots?
A Highest Density Region (HDR) of probability coverage 1 - α (such as 50%, 75%, or 95%) is the unique spatial domain R on the 2D plane such that: (1) the total integrated probability over R equals 1 - α, and (2) the estimated density f̂(x, y) at every point inside R is strictly greater than or equal to the density at any point outside R. HDR contours represent the most compact two-dimensional regions containing a specified fraction of the population probability mass.
Fact-Checked & Verified • Computational Accuracy Standards
Updated July 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue