qmc · discrepancy bench

GO · WEBASSEMBLY · NO JS NUMERICS

Every pair at once, and what it costs you

The Point Lab shows one projection out of d(d−1)/2. This page shows all of them: a correlation matrix over every pair of dimensions, and then the thing correlation is a proxy for — how fast the integration error actually falls as you spend more points.

Both halves are computed by github.com/cwbudde/qmc compiled to WebAssembly. The JavaScript owns the DOM, the canvas and the clock.

Loading WebAssembly…
Pairwise correlation

Cell (i, j) is the Pearson correlation between coordinate i and coordinate j over the whole point set. Correlation is signed, so the scale is diverging and centred on zero: cool is negative, warm is positive, ground is near zero linear association. The diagonal is 1 by construction. Hover any cell for the pair and r, and for their prime bases.

worst adjacent |r| — —
measurement configuration The current result and its configuration will appear here.
The switch

—

Point set
39
600
64

—

Map

Correlation is loading.

Pearson correlation r ranges from −1 to +1: negative values use blue, zero is dark, and positive values use rose. The diagonal is 1. Values measure linear association, not general independence. Dimension indices start at zero.

hover a cell for the pair, their bases and r

Correlation values and keyboard explorer

Tab enters the values. Arrow keys move by row or column; Home and End move within a row; Control + Home or End moves to the first or last value. Tab leaves the matrix.

Waiting for correlation values.
Convergence

Absolute integration error against N, both axes logarithmic — a power law is a straight line here. The dotted 1/√N and 1/N slopes are references, not guarantees for a single run. Monte Carlo RMS error scales as 1/√N for finite-variance integrands; QMC behavior depends on the function, dimensions and sampled block. Compare several seeds and budgets.

Problem
8
64

—

—

Sweep

idle

Latest N
exact value —
qmc error —
mc error —
mc ÷ qmc —
N QMC |err| MC |err| ratio

No completed convergence rungs.

No results for the current settings.

quasi-Monte Carlo — circles pseudo-random Monte Carlo — crosses reference slopes 1/N and 1/√N
Discrepancy

The quantity the phrase "low-discrepancy sequence" actually refers to, measured against N on log–log axes: the sequence's discrepancy, a pseudorandom sample's over the same N, and — for centred L2 — the analytic random RMS baseline √(((5/4)s − (13/12)s)/N) of the random one, √E[CD2²], rather than mean discrepancy E[CD2]. The headline is the measured ratio random ÷ sequence; a ratio near one means these two sets have similar scores on this metric.

random ÷ sequence — Press Start to compare the selected point sets. At high dimensions centred L2 can distinguish useful sequences from random points only weakly.
Metric

—

Point set
39
64

—

Latest N
sequence —
pseudo-random —
analytic random RMS —
N ceiling here —

idle

N sequence random ratio

—

No completed discrepancy rungs.

No results for the current settings.

the sequence — circles pseudo-random — crosses analytic random RMS baseline — no markers

Reading the numbers

Correlation is a symptom, not the disease. A low-discrepancy sequence aims for even coverage of the whole box. Pairwise correlation measures linear association; small sample coefficients neither establish independence nor guarantee low discrepancy or integration accuracy.

A single seed is a single sample. With any randomization selected this is randomized quasi-Monte Carlo: seeds can give different point sets, and both the worst pair and the error curve can vary. One displayed seed does not summarize the distribution over seeds or measure undetected bias.

Centred L2 can separate point sets only weakly at high dimensions. For independent continuous uniform points, its random RMS baseline √E[CD2²] is √(((5/4)s − (13/12)s)/N). This is not the mean E[CD2]. The (5/4)s term dominates that squared expectation as dimensions grow, but does not determine the ratio for a particular seed or sequence. Compare lower dimensions and available metrics. Generic multi-point star evaluation has dimension and work limits; the library also has cheap one-point and one-dimensional paths. The menu reports acceptance for the demo's minimum of two points, separately from its own work ceilings.

The discrepancy panel's N ceiling moves with dimensions. General centred L2 costs O(N²s), so its work-policy cap falls as dimensions are added. One dimension uses a cheaper formula. These caps bound computation work; they do not promise the same runtime on every device.

The sweep runs in a computation worker. Each Go call covers one N; completed rungs fill the chart one point at a time. Controls remain available while a rung runs. Stop terminates that worker immediately, and request IDs prevent an obsolete result from joining a restarted sweep. Correlation uses its own worker channel.