Generator

Leverage and the deleted residual for 40 observations of a 6-column fit

One function in the update library, called 41 times across 6 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 72 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 leverage and the deleted residual for 40 observations of a 6-column fit. The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.150 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 40 times without each observation; the two agree to 1.3·10⁻¹². The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

leverage-hat is one function in lib/figures/update.js — rank-one — the correction that is cheaper than the problem, and what it charges. 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.

Leverage and the deleted residual for 40 observations of a 6-column fitThe upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.150 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 40 times without each observation; the two agree to 1.3·10⁻¹². The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.the diagonal of the hat matrix, hᵢ = aᵢᵀ(AᵀA)⁻¹aᵢ · dashed: its average p/m = 0.150p/m10the leave-one-out residual: eᵢ/(1 − hᵢ), and forty refitsbars: closed form · dots: refitted without that pointone number, two fieldsΣ hᵢ, exactly p6largest leverage0.5closed form against refits1.3·10⁻¹²1 − h of the first row0.5y appears in the residualand nowhere in the leverage

The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.150 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 40 times without each observation; the two agree to 1.3·10⁻¹². The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

m: 50, p: 10

The arguments are the ones Influence is decided before the data passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Leverage and the deleted residual for 50 observations of a 10-column fitThe upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.200 drawn through it; the leverages sum to 10.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 50 times without each observation; the two agree to 8.9·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.the diagonal of the hat matrix, hᵢ = aᵢᵀ(AᵀA)⁻¹aᵢ · dashed: its average p/m = 0.200p/m10the leave-one-out residual: eᵢ/(1 − hᵢ), and forty refitsbars: closed form · dots: refitted without that pointone number, two fieldsΣ hᵢ, exactly p10largest leverage0.5closed form against refits8.9·10⁻¹³1 − h of the first row0.5y appears in the residualand nowhere in the leverage

The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.200 drawn through it; the leverages sum to 10.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 50 times without each observation; the two agree to 8.9·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

m: 40, p: 6

The arguments are the ones Influence is decided before the data passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Leverage and the deleted residual for 40 observations of a 6-column fitThe upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.150 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 40 times without each observation; the two agree to 1.3·10⁻¹². The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.the diagonal of the hat matrix, hᵢ = aᵢᵀ(AᵀA)⁻¹aᵢ · dashed: its average p/m = 0.150p/m10the leave-one-out residual: eᵢ/(1 − hᵢ), and forty refitsbars: closed form · dots: refitted without that pointone number, two fieldsΣ hᵢ, exactly p6largest leverage0.5closed form against refits1.3·10⁻¹²1 − h of the first row0.5y appears in the residualand nowhere in the leverage

The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.150 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 40 times without each observation; the two agree to 1.3·10⁻¹². The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

m: 60, p: 3

The arguments are the ones Influence is decided before the data passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Leverage and the deleted residual for 60 observations of a 3-column fitThe upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.050 drawn through it; the leverages sum to 3.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 60 times without each observation; the two agree to 1.2·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.the diagonal of the hat matrix, hᵢ = aᵢᵀ(AᵀA)⁻¹aᵢ · dashed: its average p/m = 0.05010the leave-one-out residual: eᵢ/(1 − hᵢ), and forty refitsbars: closed form · dots: refitted without that pointone number, two fieldsΣ hᵢ, exactly p3largest leverage0.5closed form against refits1.2·10⁻¹³1 − h of the first row0.5y appears in the residualand nowhere in the leverage

The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.050 drawn through it; the leverages sum to 3.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 60 times without each observation; the two agree to 1.2·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

m: 32, p: 8

The arguments are the ones Influence is decided before the data passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Leverage and the deleted residual for 32 observations of a 8-column fitThe upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.250 drawn through it; the leverages sum to 8.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 32 times without each observation; the two agree to 1.5·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.the diagonal of the hat matrix, hᵢ = aᵢᵀ(AᵀA)⁻¹aᵢ · dashed: its average p/m = 0.250p/m10the leave-one-out residual: eᵢ/(1 − hᵢ), and forty refitsbars: closed form · dots: refitted without that pointone number, two fieldsΣ hᵢ, exactly p8largest leverage0.5closed form against refits1.5·10⁻¹³1 − h of the first row0.5y appears in the residualand nowhere in the leverage

The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.250 drawn through it; the leverages sum to 8.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 32 times without each observation; the two agree to 1.5·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

m: 60, p: 6

The arguments are the ones Influence is decided before the data passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Leverage and the deleted residual for 60 observations of a 6-column fitThe upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.100 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 60 times without each observation; the two agree to 4.2·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.the diagonal of the hat matrix, hᵢ = aᵢᵀ(AᵀA)⁻¹aᵢ · dashed: its average p/m = 0.10010the leave-one-out residual: eᵢ/(1 − hᵢ), and forty refitsbars: closed form · dots: refitted without that pointone number, two fieldsΣ hᵢ, exactly p6largest leverage0.5closed form against refits4.2·10⁻¹³1 − h of the first row0.5y appears in the residualand nowhere in the leverage

The upper panel is the diagonal of the hat matrix, one bar per observation, with the average p/m = 0.100 drawn through it; the leverages sum to 6.000000000, which is exactly the number of columns. The lower panel is the leave-one-out residual, computed in closed form as eᵢ/(1 − hᵢ) and, separately, by refitting the model 60 times without each observation; the two agree to 4.2·10⁻¹³. The first observation carries a leverage of 0.5000 by construction, and 1 − h is the number a hyperbolic downdate takes the square root of.

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.

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

the complement's row norm keeps 1 − h at k = 2 — checked 10 times

the reflector route keeps the divisor at k = 2 — checked 10 times

joint over single deleted residual is (1 − h)/(1 − 2h) at x = 1.5 — checked 8 times

the reflector route is the complement at x = 2 — checked 7 times

the complement is never wrong by more than ten times κ(A)·u, at x = 100 — checked 4 times

1/(1 − h) is κ(A)² to within a factor of ten once the point is well outside

a design the exact rational leverage is affordable on

a far point outside the ordinary ones

a finite double, since an infinity is not a rational

a late heavy row damages the light rows' residuals

a number of columns a design matrix can carry

a pair placed outside the ordinary points

a polynomial degree the exact leverage is affordable at

a position the diagnostic sweep measures

a position the sweep measures

a position the sweep measures: first, middle or last

a view of the leverage this figure draws

a weight 4^k the exact leverage can afford

a weight 4^k the exact residual can afford

a well-conditioned pair still loses digits with the light rows first

and each fit without one twin predicts it off by less

and every one of them is below one

and the closed form agrees with refitting the model without each point

b − Ax sits within a factor of thirty of u·|bᵢ|/|rᵢ| in every case from 4^9 to 4^24

elsewhere it loses digits

enough observations for a leave-one-out sweep

every unsorted error sits between a two-thousandth of u times the heavy row's scale and that product

first, the complement keeps every digit

first, the complement's residual keeps every digit

Jacobi needs a symmetric matrix

LU is for square matrices

matmul shapes agree

the fit without the pair predicts it off by about the shift it shares

the leverages sum to the number of columns, exactly

the refit is right at every weight

the smaller eigenvalue grows about as the square of the separation

the solution's residual has no digit at 4^30 in any order

while s² from the same residuals keeps its digits

Against the rule

The rule does not apply to it. It factorises nothing, so there is no residual it could be withholding. That is worth stating rather than leaving blank: a site that reported the rule as satisfied by every generator would be counting mostly generators the rule never reached.

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.

Least squares, and the road not to take

Influence is decided before the data

The diagonal of the hat matrix sums to the number of columns and the response appears nowhere in it, so a fit has exactly p units of influence to hand out among m observations. The same row at h = 0.5 is a ten-fold outlier on one design and a boundary case on another, and which of those it is was settled before a single measurement was taken.

Least squares, and the road not to take

One minus a leverage is a subtraction

Every deletion diagnostic divides by 1 − h, and computing it as one minus a computed leverage loses digits in proportion to 1/(1 − h), however accurate the leverage. The complementary block of a QR factor gives the same number as a sum of squares and loses κ(A)·u instead: every digit on a well-conditioned design, and half the digits the subtraction loses on a design whose far point is what made 1 − h small.

Least squares, and the road not to take

The factor a sparse code keeps anyway

Every deletion diagnostic divides by one minus a leverage, and computing it as a subtraction loses a digit for every decade the leverage is from one. The route that does not subtract needs the orthogonal factor, which a sparse factorisation is supposed not to have. Three repairs that avoid it all fail at exactly a unit of roundoff over the divisor — and the fourth, which reaches the orthogonal factor through the Householder vectors a sparse code keeps in order to solve anything at all, returns the same bits as a stored factor in 900 operations.

Least squares, and the road not to take

The residual the solution cannot hold

Sorting a weighted fit's rows heaviest first gave every digit of one minus the heavy row's leverage back. It gives nothing back to the heavy row's residual, if that residual is computed the way every textbook computes it — as the datum minus the fitted value. The fitted value is a double, and a double cannot resolve a misfit smaller than its own last digit times the weight: at a weight of 4²⁴ the residual formed from the solution is wrong in its second digit in every order, and forming the subtraction exactly changes nothing. Taken from the same orthogonal factor as the divisor, the residual keeps fifteen digits, and so does Cook's distance at 3.4·10¹⁷.

Least squares, and the road not to take

The weight the factor met first

The route to one minus a leverage through the orthogonal factor was said to lose a digit for every decade of the condition number, whatever else it does. Put a weight on one row and it does not. With the heavy row first, the complement keeps every digit at κ(A) = 2.5·10⁹ while both subtractions return nothing. With the same row last it loses digits as the row's scale grows. And two heavy rows that leave κ(A) at 3.1 still lose six digits when the light rows come first. The law was about the order the factor met the rows, and the condition number had been standing in for it.

Least squares, and the road not to take

Two observations that hide each other

Two observations at the same place, wrong by the same amount, each look harmless when deleted alone, because a fit without one still has the other. Single deletion sees the shared error cut by (1 − 2h)/(1 − h) — measured at 261 times at the far end — and only the pair's two-by-two block of the hat matrix says what the two of them hold.

The whole library · All essays · What must fail