Generator

Error of the best rank-k approximation to a 10×10 matrix

One function in the spectra library, called 11 times across 6 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 59 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 error of the best rank-k approximation to a 10×10 matrix. Approximation error against k on a logarithmic axis for a 10×10 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 9 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 969.

low-rank-error is one function in lib/figures/spectra.js — spectra — sensitivity, the symmetric easy case, and rank as a decision. 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.

Error of the best rank-k approximation to a 10×10 matrixApproximation error against k on a logarithmic axis for a 10×10 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 9 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 969.12345678910⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 4.3·10⁻⁹worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁4.3·10⁻⁹worst Frobenius discrepancy4.3·10⁻⁹κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁

Approximation error against k on a logarithmic axis for a 10×10 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 9 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 969.

n: 12

The arguments are the ones A factorisation that is unique for once passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Error of the best rank-k approximation to a 12×12 matrixApproximation error against k on a logarithmic axis for a 12×12 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 11 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 263.123456789101110⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 2·10⁻⁸worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁2·10⁻⁸worst Frobenius discrepancy2·10⁻⁸κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁

Approximation error against k on a logarithmic axis for a 12×12 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 11 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 263.

n: 16

The arguments are the ones A good curve and a bad verdict passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Error of the best rank-k approximation to a 16×16 matrixApproximation error against k on a logarithmic axis for a 16×16 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 15 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 59.12345678910111213141510⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 1.5·10⁻⁸worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁1.5·10⁻⁸worst Frobenius discrepancy1.5·10⁻⁸κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁

Approximation error against k on a logarithmic axis for a 16×16 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 15 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 59.

n: 10

The arguments are the ones Randomisation does not create structure passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Error of the best rank-k approximation to a 10×10 matrixApproximation error against k on a logarithmic axis for a 10×10 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 9 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 969.12345678910⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 4.3·10⁻⁹worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁4.3·10⁻⁹worst Frobenius discrepancy4.3·10⁻⁹κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁

Approximation error against k on a logarithmic axis for a 10×10 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 9 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 969.

n: 8

The arguments are the ones The best approximation there is passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Error of the best rank-k approximation to a 8×8 matrixApproximation error against k on a logarithmic axis for a 8×8 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 7 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 6010.123456710⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 1.1·10⁻⁸worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁1.1·10⁻⁸worst Frobenius discrepancy1.1·10⁻⁸κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁

Approximation error against k on a logarithmic axis for a 8×8 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 7 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 6010.

n: 20

The arguments are the ones The best approximation there is passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Error of the best rank-k approximation to a 20×20 matrixApproximation error against k on a logarithmic axis for a 20×20 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 19 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 25.1234567891011121314151617181910⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 2·10⁻⁹worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁2·10⁻⁹worst Frobenius discrepancy2·10⁻⁹κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁

Approximation error against k on a logarithmic axis for a 20×20 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 19 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 25.

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.

59 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.

and in the Frobenius norm it is the tail from 2 on agree — checked 19 times

the Frobenius error is never below the 2-norm error at k = 1 — checked 19 times

the rank-1 error is σ2 agree — checked 19 times

and no random rank-3 matrix beats the SVD's

matmul shapes agree

Against the rule

It draws a decomposition and prints its residual. It calls svd, lowRank, 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.

When the index is a tuple

A factorisation that is unique for once

A rank-r factorisation of a matrix is never unique — AB is (AM)(M⁻¹B) for any invertible M, so no factor means anything on its own. For three indices a checkable condition on the factors' k-ranks makes the decomposition unique up to permuting and scaling the terms, and it holds generically.

Eigenvalues, singular values, rank

A good curve and a bad verdict

The diagonal of a column-pivoted R is famous for the one matrix it is wrong about. On that matrix it is right about thirty-nine of its forty entries — every |rₖₖ| within a factor of six of the σₖ it stands for — and wrong by 4·10⁶ at the fortieth, which is the only one a rank verdict ever reads.

Randomised, and the guarantee that changes kind

Randomisation does not create structure

On a matrix whose singular values are all equal, a rank-ten randomised approximation has error 1.0 — and so does the optimal deterministic one. Neither achieved anything, and only one of them is usually sold with the implication that it might.

Eigenvalues, singular values, rank

Rank is a decision

A floating-point matrix does not have a rank. It has a spectrum of singular values, and somewhere in that spectrum is a place where the values stop being signal and start being noise. Deciding where is a judgement, and the evidence for it is a gap.

Eigenvalues, singular values, rank

The best approximation there is

The error of the best rank-k approximation is not bounded by the next singular value. It is equal to it. That is an unusually sharp theorem, and it makes the theorem itself usable as an independent check on the computation.

Two errors, and whose fault they are

The zero you are allowed to write

A deflation criterion sets a subdiagonal entry to zero because it is small. A drop tolerance discards an entry of a factor because it is small. A truncation discards a singular value because it is small. Three fields, three vocabularies, no shared arithmetic — and plotted as work saved against error accepted, one curve.

The whole library · All essays · What must fail