Generator

‖A − Q‖ in the Frobenius norm for four orthogonal matrices, on an 8×8 matrix with κ = 10

One function in the polar library, called 29 times across 6 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 92 claims it put to the test while drawing them, and where it stands against the rule this site is named for.

At its defaults it draws ‖a − q‖ in the frobenius norm for four orthogonal matrices, on an 8×8 matrix with κ = 10. The polar factor is 1.8554 from A. QR with its column signs fixed is 2.1265 — 15 per cent further. QR as Householder returns it, with 7 of 8 columns negated, is 3.8226, which is further than the best of two hundred orthogonal matrices drawn at random. The strip beneath the bars is those two hundred draws, whose best is 2.6928; the polar factor is to the left of all of them, which is the minimisation being checked rather than assumed.

nearest-orthogonal is one function in lib/figures/polar.js — the polar factor — the nearest orthogonal matrix, and two ways to it without an svd. Everything below came out of it during this build, at arguments taken from the essays rather than invented for this page. A figure here is the figure a reader meets in an essay, and if the generator changes, this page changes with it.

At its defaults

Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.

‖A − Q‖ in the Frobenius norm for four orthogonal matrices, on an 8×8 matrix with κ = 10The polar factor is 1.8554 from A. QR with its column signs fixed is 2.1265 — 15 per cent further. QR as Householder returns it, with 7 of 8 columns negated, is 3.8226, which is further than the best of two hundred orthogonal matrices drawn at random. The strip beneath the bars is those two hundred draws, whose best is 2.6928; the polar factor is to the left of all of them, which is the minimisation being checked rather than assumed.how far is it from A to an orthogonal matrix?smaller is nearer · the polar factor minimises this in every unitarily invariant normpolar factor U1.8554QR, signs fixed2.1265QR as returned3.8226200 drawn at randomκ = 10polar factor1.9QR, signs fixed2.1QR as returned3.8best of 200 random2.7‖A − QR‖ is the same either wayand ‖A − Q‖ is not

The polar factor is 1.8554 from A. QR with its column signs fixed is 2.1265 — 15 per cent further. QR as Householder returns it, with 7 of 8 columns negated, is 3.8226, which is further than the best of two hundred orthogonal matrices drawn at random. The strip beneath the bars is those two hundred draws, whose best is 2.6928; the polar factor is to the left of all of them, which is the minimisation being checked rather than assumed.

show: "nd-rate"

The arguments are the ones A mirror decided in the thin directions passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

How often the polar factor of an n-dimensional alignment with k thin directions is a reflection, against the k × k determinant modelPer cent of 600 trials mirrored, against z — the noise over the thickness, divided by the square root of the point count — for alignments in n = 3, 5, 8 and 10 dimensions with k = 1, 2 or 3 directions of thickness 0.01, drawn as points, beside the rate at which the k × k matrix W/m + zG has a negative determinant, W Wishart on m points and G Gaussian, drawn as lines from 20,000 draws each, on a linear axis. At z = 0.7: n = 3, k = 1: 9.7%; n = 5, k = 1: 13%; n = 10, k = 1: 12%; n = 5, k = 2: 23%; n = 10, k = 2: 24%; n = 8, k = 3: 32%; the models give 9.5% for k = 1, 22% for k = 2, 31% for k = 3.0123401020304050z, the effective noise ratiotrials mirrored, %1 thin: 1 × 1 model2 thin: 2 × 2 model3 thin: 3 × 3 modelper cent mirrored at z = 0.7, 600 trialsn = 3, 1 thin, 20 points9.7n = 5, 1 thin, 20 points13n = 10, 1 thin, 40 points12n = 5, 2 thin, 20 points23n = 10, 2 thin, 40 points24n = 8, 3 thin, 40 points32points: measured in n dimensionslines: a k × k determinant, no n in it

Per cent of 600 trials mirrored, against z — the noise over the thickness, divided by the square root of the point count — for alignments in n = 3, 5, 8 and 10 dimensions with k = 1, 2 or 3 directions of thickness 0.01, drawn as points, beside the rate at which the k × k matrix W/m + zG has a negative determinant, W Wishart on m points and G Gaussian, drawn as lines from 20,000 draws each, on a linear axis. At z = 0.7: n = 3, k = 1: 9.7%; n = 5, k = 1: 13%; n = 10, k = 1: 12%; n = 5, k = 2: 23%; n = 10, k = 2: 24%; n = 8, k = 3: 32%; the models give 9.5% for k = 1, 22% for k = 2, 31% for k = 3.

show: "nd-independent"

The arguments are the ones A mirror decided in the thin directions passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Mirror rate with two and three thin directions: the determinant model against independent flipsFor forty points, the per cent of 20,000 draws in which W/m + zG has a negative determinant, for k × k blocks with k = 1, 2 and 3, against z, and the rate k independent flips at the one-direction rate p would give, (1 − (1 − 2p)ᵏ)/2, dashed, on linear axes. At z = 0.45 one direction mirrors 2.2%; two independent flips would give 4.2% and the determinant gives 7.0%; three would give 6.2% and the determinant gives 14%.00.511.5201020304050z, the effective noise ratiomirrored, %two, determinanttwo, independentthree, determinantthree, independentz = 0.45, forty points, per centone thin direction2.2two: independent flips4.2two: determinant7three: independent flips6.2three: determinant14dashed: k coinssolid: one determinant

For forty points, the per cent of 20,000 draws in which W/m + zG has a negative determinant, for k × k blocks with k = 1, 2 and 3, against z, and the rate k independent flips at the one-direction rate p would give, (1 − (1 − 2p)ᵏ)/2, dashed, on linear axes. At z = 0.45 one direction mirrors 2.2%; two independent flips would give 4.2% and the determinant gives 7.0%; three would give 6.2% and the determinant gives 14%.

show: "mirror-step"

The arguments are the ones A mirror decided in the thin directions passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Distance between the polar factor and the nearest rotation, 300 trials at noise ÷ thickness = 10Each trial is a dot: horizontally the smallest singular value of the cross-covariance, signed negative when the polar factor is a reflection; vertically the Frobenius distance between the polar factor and the rotation with its determinant fixed. 198 trials sit at exactly 0 and 102 at exactly 2, with nothing in between: the largest deviation from 2 is 8.9·10⁻¹⁶. In every mirrored trial the rotation's residual exceeds the reflection's by 4σ₃ to a relative 8.3·10⁻¹³.-12-10-8-6-4-202468101200.511.522.5signed σ₃ of BᵀA, ×10⁻³‖U − R‖, Frobenius102 reflections, all at 2198 rotations, all at 0no trial in betweenlargest |‖U − R‖ − 2|8.9·10⁻¹⁶largest ‖U − R‖ when not mirrored0largest |gap − 4σ₃| ÷ 4σ₃8.3·10⁻¹³20 points, thickness 10⁻²; beyond the axis a dot is drawn at its edgea flip, not a drift

Each trial is a dot: horizontally the smallest singular value of the cross-covariance, signed negative when the polar factor is a reflection; vertically the Frobenius distance between the polar factor and the rotation with its determinant fixed. 198 trials sit at exactly 0 and 102 at exactly 2, with nothing in between: the largest deviation from 2 is 8.9·10⁻¹⁶. In every mirrored trial the rotation's residual exceeds the reflection's by 4σ₃ to a relative 8.3·10⁻¹³.

show: "nd-error"

The arguments are the ones A mirror decided in the thin directions passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The determinant-fixed rotation's error with one, two and three thin directions, z = 0.7Median distance of the determinant-fixed rotation from the true one, divided by the noise, over 400 alignments at z = 0.7, split into trials whose polar factor was a rotation and trials where it was a reflection and was fixed. n = 5 with 1 thin direction: 7.5% mirrored, error 0.59σ unmirrored and 0.61σ fixed; n = 5 with 2 thin directions: 22% mirrored, error 10.93σ unmirrored and 15.77σ fixed; n = 8 with 3 thin directions: 30% mirrored, error 24.23σ unmirrored and 29.26σ fixed.median error of the rotation ÷ noisen = 5, 1 thin7.5% mirrored0.59 not mirrored0.61 mirrored, fixedn = 5, 2 thin22% mirrored10.93 not mirrored15.77 mirrored, fixedn = 8, 3 thin30% mirrored24.23 not mirrored29.26 mirrored, fixedone thin direction: the fix is exacttwo or more: a rotation the data cannot see

Median distance of the determinant-fixed rotation from the true one, divided by the noise, over 400 alignments at z = 0.7, split into trials whose polar factor was a rotation and trials where it was a reflection and was fixed. n = 5 with 1 thin direction: 7.5% mirrored, error 0.59σ unmirrored and 0.61σ fixed; n = 5 with 2 thin directions: 22% mirrored, error 10.93σ unmirrored and 15.77σ fixed; n = 8 with 3 thin directions: 30% mirrored, error 24.23σ unmirrored and 29.26σ fixed.

show: "nd-error", z: 0.45

The arguments are the ones A mirror decided in the thin directions passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The determinant-fixed rotation's error with one, two and three thin directions, z = 0.45Median distance of the determinant-fixed rotation from the true one, divided by the noise, over 400 alignments at z = 0.45, split into trials whose polar factor was a rotation and trials where it was a reflection and was fixed. n = 5 with 1 thin direction: 1.5% mirrored, error 0.60σ unmirrored and 0.68σ fixed; n = 5 with 2 thin directions: 4.8% mirrored, error 10.98σ unmirrored and 17.93σ fixed; n = 8 with 3 thin directions: 13% mirrored, error 26.08σ unmirrored and 38.99σ fixed.median error of the rotation ÷ noisen = 5, 1 thin1.5% mirrored0.60 not mirrored0.68 mirrored, fixedn = 5, 2 thin4.8% mirrored10.98 not mirrored17.93 mirrored, fixedn = 8, 3 thin13% mirrored26.08 not mirrored38.99 mirrored, fixedone thin direction: the fix is exacttwo or more: a rotation the data cannot see

Median distance of the determinant-fixed rotation from the true one, divided by the noise, over 400 alignments at z = 0.45, split into trials whose polar factor was a rotation and trials where it was a reflection and was fixed. n = 5 with 1 thin direction: 1.5% mirrored, error 0.60σ unmirrored and 0.68σ fixed; n = 5 with 2 thin directions: 4.8% mirrored, error 10.98σ unmirrored and 17.93σ fixed; n = 8 with 3 thin directions: 13% mirrored, error 26.08σ unmirrored and 38.99σ fixed.

What it checked while drawing

Every figure above checked its own claims on the way to being drawn, and a claim that failed would have stopped the picture rather than shipped a wrong one. Those checks used to leave no trace at all: a passing one returned true and the only evidence the figure had checked anything was that nothing crashed. The list below is what they actually said, collected by running this generator with an observer installed — not a description of what it is believed to check.

92 distinct claims across 6 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.

n = 3, k = 1 follows the 1 × 1 model at z = 0.45 — checked 16 times

at σ/t = 1 the three thicknesses mirror at one rate, to sampling error — checked 8 times

mirrored, √2/(σ₂ − σ₃) at σ₃/σ₂ = 0.01 — checked 7 times

unmirrored, √2/(σ₂ + σ₃) at σ₃/σ₂ = 0.01 — checked 7 times

equal noise, five weighted ×100 mirrors at the five-point rate at z = 0.3 — checked 5 times

five precise, weighted 1/σ² mirrors at the five-point rate at z = 0.3 — checked 5 times

the constructed matrix has κ = 10 — checked 5 times

a 3 × 3 cross-covariance, which is the case the correction is stated for

a conditioning between nearly orthogonal and badly stretched

a dimension, a number of thin directions below it, and more points than dimensions

a mode this family draws: mirror-rate, mirror-thickness, mirror-step or mirror-sensitivity

a noise level the thickness axis brackets on both sides

a noise ratio the error comparison is drawn at

a noise-to-thickness ratio at which both outcomes occur

a perturbation small enough not to change which side of the mirror the answer is on

a point count the sweep is drawn at

a point set with more points than dimensions

a power of ten rather than an exponent literal

a ratio σ₃/σ₂ strictly between a plane and a rod

a setting with both outcomes to draw

a size the two hundred random draws can afford

a thickness the SVD separates from exact rank deficiency

a weight for every point, and more points than dimensions

a weighting scheme this measurement defines

and every mirror is cheaper than the rotation by exactly 4σ₃

and it is at least as near as the sign-fixed QR factor

and nearer than the best of two hundred random orthogonal matrices

and never passes a coin

and no mirror while the set is ten times thicker than the noise

enough trials for a percentage and few enough to draw

every trial is exactly 0 or exactly 2 from the rotation

five heavy points mirror near the five-point rate

LU is for square matrices

matmul shapes agree

near a rod the fixed rotation is fifty times more sensitive

once the set is a disc, the rotation's error per unit of noise does not move

one heavy point mirrors far less than any small unweighted set

one thin direction leaves the rotation at the noise

the polar factor is orthogonal to rounding

the rate rises with noise over thickness

two leave it far off, mirrored or not

two thin directions mirror more than independent flips predict

weighting equally noisy points heavily raises it

weighting the precise points cuts the rate at σ/t = 10

while at the thinnest the polar factor is more than twenty times further off

while the unfixed factorisation reconstructs A perfectly

Against the rule

It draws a decomposition and prints its residual. It calls qrHouseholder, and every figure above carries the badge — which residualcheck verifies by looking for it in the emitted SVG rather than by finding the call that builds one. A badge that is constructed and then left out of the body is the failure that check exists for.

Across the library: the rule bites on 217 of 397 generators — 199 print a residual and 18 are exempt with a published reason; 180 factorise nothing. Read from lib/residual-rule.js, which is the same body the gate enforces from, and the gate's last check fails the build if this page and it disagree about any generator.

Where it is called

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

Orthogonality, measured

A mirror decided in the thin directions

In n dimensions the nearest orthogonal matrix to a noisy alignment is still sometimes a reflection, and the rate at which it is does not depend on n. Three, five and ten dimensions with one thin direction mirror alike; two thin directions mirror like each other in five dimensions and in ten. The rate is the chance that a k × k matrix built from the k thin directions has a negative determinant — 21.7 per cent at a noise ratio of 0.7 for k = 2, measured at 23.0 — and it is well above k independent coin flips. With two or more thin directions the determinant correction still fires, and it no longer rescues the rotation: the answer is eleven noise-widths off whether or not it was mirrored.

Orthogonality, measured

A rotation that comes back mirrored

Align twenty noisy points and the nearest orthogonal matrix to the answer is a reflection in 7.7 per cent of trials at noise three times the set's thickness and a third of them at ten — at thicknesses of 10⁻², 10⁻³ and 10⁻⁴ alike. The determinant fix is never a small correction. It moves the answer by exactly 2, it costs exactly 4σ₃ of residual, and it leaves the rotation's error at half the noise however thin the set becomes.

Orthogonality, measured

A test with no answer in it

A caller with no reference answer can still ask whether a routine answered the right question: reverse the columns, run it again, compare. The polar factor's two answers agree to 10⁻¹⁵ at every conditioning drawn; a QR's differ by 2.353 on matrices whose own norm is 2.449. The test has a floor, and the floor is measurable too.

Orthogonality, measured

An iteration that only multiplies

Newton's iteration for the polar factor needs an inverse every step. Newton–Schulz needs only matrix products — nothing that reads an entry, nothing that pivots — and it converges if and only if every singular value is below √3. At 1.73205 it converges and at 1.73206 it returns an orthogonal matrix that is not the answer, with a residual of 5·10⁻¹⁶ and nothing to say so.

Orthogonality, measured

Five precise points are five points

Weighting each sighting by its reliability is the standard form of an attitude or registration fit, and it changes how often the nearest orthogonal matrix comes back as a mirror. Measured, the rate is a function of two numbers: the weighted noise over thickness, and the effective count (Σw)²/Σw². Five points with a tenth of the noise, weighted by 1/σ², carry the information of 515 equal points and mirror like five — 7.9 per cent at a noise ratio where twenty points mirror 1.8 and five mirror 9.5. The √m the earlier measurement left unchecked is right, and it counts what carries the thin direction.

Orthogonality, measured

The nearest orthogonal matrix

Every field that has to clean up a drifted rotation reaches for QR, and QR does not answer the question. The nearest orthogonal matrix is the orthogonal factor of the polar decomposition — nearer by about a tenth, and, more to the point, the same matrix whatever order the columns were written in. QR's answer changes completely.

The whole library · All essays · What must fail