No subtraction, and no waiting
Worth reading first: An eigenvector that must not change sign · A ranking that is an eigenvector.
An eigenvector that must not change sign found the Perron vector of a clique with a long tail coming back from a symmetric eigensolver with negative entries, where Perron’s theorem says every entry is positive — and found the power iteration returning every one of them, down to , correct to several digits. The reason was a sentence long: the power iteration multiplies a nonnegative vector by a nonnegative matrix, forms only sums of positive numbers, and so can neither produce a negative entry nor lose a small one to cancellation. “A property guaranteed by a theorem is preserved numerically only by an algorithm whose arithmetic cannot violate it.”
A ranking whose order is not determined then found the price: the power iteration’s change between steps understates its remaining error by , and a chain whose second eigenvalue is near one converges slowly. Both essays were about one route that never subtracts and one that does. There is a third, and it is the one every Markov-chain code uses.
Three routes to one vector
A Markov chain’s stationary vector satisfies with ; it is the Perron vector of the transposed transition matrix, positive whenever the chain is irreducible.
The power iteration multiplies by and renormalises, every step, from the uniform vector. Gaussian elimination with partial pivoting solves with one equation replaced by , as any linear-algebra library would. And the Grassmann–Taksar–Heyman elimination is Gaussian elimination on rearranged so that no subtraction happens anywhere: each pivot, which ordinary elimination would compute as one minus a diagonal entry, is computed instead as the sum of the off-diagonal entries in its row — the same number, written as a sum of positive probabilities — and every update adds a product of probabilities to a probability.
Three states are enough to see the rearrangement. Take the chain whose rows are , and . GTH eliminates the last state first: the probability of leaving it for the other two is , and every path through it is folded into the remaining chain — the entry from the first state to the second becomes , from the second to the first . Then the second state: its probability of leaving for the first is , read directly off the folded chain. Ordinary elimination would have reached the same pivot as , one minus the folded diagonal; GTH never forms the diagonal at all. Back substitution is the same kind of arithmetic: , , , normalised to , and , which is the stationary vector exactly. Every number in the computation is a sum, product or quotient of positive probabilities.
Each route is checked against the exact answer. The chains are stored in double precision, and their stationary vector is solved again in rational arithmetic from the stored numbers, with each diagonal of taken as the exact sum of its row’s stored off-diagonal entries — the chain all three routes are actually given, since a stored row sums to one only to rounding and on a nearly decomposable chain that difference matters.
Two families of 24 states, each built to stress one property. Two dense clusters of twelve states joined by a coupling — every row of the first sends a fraction of its probability to the second, every row of the second sends back — so that the chain’s second eigenvalue is within about of one and mixing takes about steps. And birth–death chains whose stationary entries fall by a factor per state, so that the last is of the first: at , at .
Every entry, every chain
The figure at the top of the page is the whole of the cluster family. GTH holds every entry to between and relative error at every coupling from to . Gaussian elimination’s worst entry error grows as the coupling shrinks — at , at , at , at , close to . The power iteration, run until it stops moving or for 200,000 steps, is accurate at the strong couplings and has not converged at all from down.
What Gaussian elimination gets wrong on the clusters is specific, and it is not the small entries — on this family no entry is small. At every entry of the first cluster is too large by the same relative and every entry of the second too small by the same : a quarter of the probability and three quarters, and of it moved from one to the other. At the transfer is the other way and four thousand times larger. The shape of the vector inside each cluster is exact to rounding; what is wrong is only how much of the total each cluster holds. That is the quantity that depends on the coupling — the shares are set by the ratio of the rates between the clusters, against — and it is the one an absolute error of a rounding in a transition probability of size moves by .
The decaying chains separate the two eliminations entry by entry. Gaussian elimination computes each entry to an absolute accuracy of about a rounding of the largest, so its relative error climbs one decade per decade of the entry’s smallness: right to on the first state, wrong in every digit by the fifth or sixth at , and from there on returning numbers around — noise — where the true entries run down to . At eight of those noise entries are negative. Measured in absolute terms, Gaussian elimination is doing exactly what it promises: its largest error on any entry is of the largest entry at and at — a rounding of the biggest number in the problem, spread over every entry. The last three entries it returns at are all , the same number three times: not three approximations to three different tiny probabilities, but the floor the absolute error leaves. GTH’s error is flat across the whole vector, under on an entry of as on an entry of a half, which is the property an eigenvector that must not change sign found in the power iteration, delivered by an elimination.
On this family the power iteration is also accurate, and quick: the chain mixes fast, and it reaches on every entry in 250 to 650 steps. The decaying chain is the case the earlier essay measured, and it confirms it.
The power iteration pays twice
The clusters are the case it did not measure.
From the uniform vector the clusters hold the wrong shares of probability — a half each, where the answer gives the second three quarters — and moving probability between clusters is exactly the slow mode. So the error sits near one for about steps before it falls. The iteration reaches a relative on every entry after 680 steps at , 6,900 at and 69,370 at : between 6.8 and 6.9 times . At , after 200,000 steps, it is still 45 per cent wrong; at , 99 per cent.
That is the first price, and it is the one the ranking essay’s stopping test was about. The second is where it stops.
The power iteration in floating point is a deterministic map on floating-point vectors, and it eventually reaches a fixed point of that map and stops moving. The fixed point is not the stationary vector. At the iteration stalls by step 79,000 at a relative error of and never changes again; at , at . Measured on nine chains — five couplings from to and three random cluster structures — the stall sits between 0.12 and 1.15 times , where is the chain’s spectral gap. Each step’s rounding nudges the vector by about , and in the slow direction the map only pulls it back by a fraction per step, so the fixed point settles where the two balance.
So the power iteration’s subtraction-free arithmetic gives it entrywise accuracy only up to the rounding divided by the gap. On the earlier essay’s clique that was invisible, because that graph’s gap is large. On a nearly decomposable chain it is the whole story.
Its stopping test reads the change, not the error
A code running the power iteration does not have the exact answer to compare against. It stops when the vector stops changing, and a ranking whose order is not determined measured how badly that reads the error: the change between iterates understates the remaining error by . On these chains the second eigenvalue is , so the factor is , and it is exact. Stopped at the first step where no entry changes by more than a relative , the iteration’s true error is at , at and at — 23, 249 and 2,500 times the tolerance, against of 25, 250 and 2,500. A tolerance of buys nine correct digits at the weakest coupling measured and would buy three at .
A chain with no stationary vector found the same division necessary for a periodic chain, where the change never falls at all. Here it falls and lies. Neither failure is in the arithmetic; both are in reading a step’s change as a distance to the answer, which on a slowly mixing chain it is not, by exactly the mixing time.
Why GTH does not care
The last two results seem to point in opposite directions. Gaussian elimination’s error grows like , which suggests a problem that is ill conditioned when the clusters are weakly coupled; GTH’s does not grow at all, which suggests one that is not. Both readings are right, about two different kinds of perturbation.
Multiply every off-diagonal probability by , with standard normal, and solve exactly again: the stationary vector’s largest relative change is to times at every coupling from to . Move every probability instead by times the largest one — an absolute perturbation, the same size everywhere — and the change grows like , about times the perturbation, until at the perturbation is larger than the coupling itself. On the decaying chains it is the same: relative sensitivity 3.8 to 3.9 at every decay, and absolute sensitivity 76 at , 733 at , at and at — between 7.2 and 7.6 times . Each small entry is held up by a single small probability, the one that leads into it from the state before; an absolute perturbation of fixed size is a relative perturbation of times that size on that probability, and the entry moves accordingly. A relative perturbation of the same probability moves it by the probability’s own relative change, which is why the deep tail costs GTH nothing.
The stationary vector is well conditioned under small relative changes to the transition probabilities, however slowly the chain mixes, and ill conditioned under small absolute changes. Which matters depends on what a method’s rounding amounts to. GTH forms every quantity as sums and products of probabilities; each of its roundings is a small relative change to a probability, and the measurement above says those move the answer by about their own size. Gaussian elimination subtracts, and its backward error is a small absolute perturbation of the whole of — the kind the vector is sensitive to as . The same distinction runs through accurate is not a property of a method, where a bidiagonal singular-value algorithm computed tiny singular values to full relative accuracy because its rounding perturbed the matrix’s entries relatively and those singular values were relatively well conditioned. A Markov chain’s stationary vector is that situation for a nonsymmetric problem: the theorem that guarantees positivity also, in a quantitative form, guarantees insensitivity to relative change, and the elimination that perturbs only relatively inherits the guarantee.
The difference between the two eliminations is not their arithmetic’s precision. It is which of the two condition numbers their errors meet, which is the distinction two condition numbers of one matrix drew for a linear system’s scaling.
No waiting either
GTH is a direct method. It costs about multiply-adds whatever the chain — 4,608 at — half of Gaussian elimination’s, since it eliminates only one triangle. The power iteration costs per step, so at its 69,370 steps are about 40 million multiply-adds, nearly nine thousand times GTH’s, for an answer it stalls at 350 times less accurate. Even on the decaying chains, where the power iteration is at its best, its 250 to 650 steps are 140,000 to 370,000 multiply-adds — thirty to eighty times GTH’s — for a vector it stalls at between and , where GTH’s is under . The rate is the second eigenvalue is the reason it cannot be otherwise: an iterative method’s speed is set by the chain’s mixing, and an elimination’s is not.
That is the place GTH occupies. The power iteration never subtracts and has to wait for the chain to mix. Gaussian elimination never waits and subtracts. GTH is the one that does neither, and on every chain measured here it is both the most accurate route and the cheapest.
What two families of 24 states do not show
The chains are small and dense, so all three routes are run exactly as written, with no sparsity and no ordering decisions. On a large sparse chain GTH fills in like any elimination and the power iteration’s cost per step is proportional to the number of transitions, so the cost comparison turns on fill — the order decides the memory is the place that is priced. The power iteration is the plain one; an iteration that aggregates the clusters and iterates on the aggregated chain is the standard repair for slow mixing and is not measured. And every probability here is a normal double; the well on the far side of the band asked what happens to GTH’s guarantee when the small entries fall below the smallest normal number, and that question is untouched — every entry here, even , is normal.
Still open: the subnormal band, aggregation, and a third cluster
Below the smallest normal number. Push the decaying chain’s ratio to per state, so that its tail enters the subnormal range near state twenty. The prediction with a sign is that GTH’s relative accuracy fails exactly at the first entry below , as the recurrence in the earlier essay did, and that its error there grows like the subnormal spacing over the entry — the band decides, not the elimination.
Aggregation. Iterative aggregation–disaggregation solves a small chain between clusters and the clusters separately, and is the standard cure for the power iteration’s steps. The prediction is that on the two-cluster chain it reaches in a number of steps independent of — under thirty from to — and that its stall point is independent of as well, because the aggregated chain is solved directly.
Three clusters in a line. Couple three clusters in a chain, the middle one to both ends by and the ends not at all. The prediction is that the power iteration then needs about steps rather than — the slowest mode moves probability from one end to the other through the middle — while GTH’s error stays at and Gaussian elimination’s grows like .
Named objects
A flat tag is an object no other essay names yet.
Componentwise condition numberGaussian eliminationMixing timePerron frobeniusPower iterationRelative accuracyStationary distribution