Analysis

The route round that rates cannot avoid

A table of yearly moves between states came from steady rates only if it is the exponential of a rate matrix. With two states that is true of half of all tables, with three of one in twenty-four, with four of about one in two thousand, and of none of 400,000 tables drawn at random with five. Even a table that is nine parts staying put fails more and more often as states are added, and always for one reason: rates that carry 1 to 2 and 2 to 3 also carry 1 to 3, and a table whose direct move is rarer than that route round cannot have come from them.

Worth reading first: When a table of moves came from steady rates · The matrix that has no logarithm.

When a table of moves came from steady rates asked of a table of yearly moves between three states — the share of each state’s members found in each state a year later — whether it could have been produced by a process jumping between the states at constant rates. Such a process turns a rate matrix QQ into the yearly table P=eQP = e^{Q}, so the question is whether PP has a logarithm with non-negative rates off the diagonal. For three states the answer was yes for about one table in twenty-three drawn at random, and its last section noted that four states and beyond were harder.

This essay takes the count to six states and finds the share collapsing — but the collapse is not the interesting part. Tables close to doing nothing, which have steady rates behind them almost always when there are two or three states, fail more and more often as states are added, and they all fail the same way. The reason is a route round: steady rates that move anyone from 1 to 2 and from 2 to 3 inevitably move some of them from 1 to 3 within the year, by way of 2, and a table that does not show that traffic could not have been made by rates. With nn states there are n(n−1)n(n-1) ordered pairs, each a separate chance to fall short.

Fewer tables have rates behind them as states are added. n=2: 0.02:1.000 0.05:1.000 0.1:1.000 0.2:1.000 0.3:1.000 0.5:1.000 0.7:0.847 1:0.489; n=3: 0.02:0.975 0.05:0.945 0.1:0.881 0.2:0.797 0.3:0.690 0.5:0.453 0.7:0.244 1:0.043; n=4: 0.02:0.941 0.05:0.865 0.1:0.735 0.2:0.520 0.3:0.329 0.5:0.108 0.7:0.019 1:0.001; n=5: 0.02:0.896 0.05:0.755 0.1:0.526 0.2:0.275 0.3:0.130 0.5:0.020 0.7:0.001 1:0.000; n=6: 0.02:0.807 0.05:0.575 0.1:0.388 0.2:0.090 0.3:0.025 0.5:0.000 0.7:0.000 1:0.000
Fig. 1 The share of tables, blended from staying put and a random table in the proportion 1−s1 - s to ss, that are exponentials of steady rates, for two to six states. At s=1s = 1 it falls from a half to 4.3% to 0.13% to none; at every ss, every added state lowers it.

Testing a table of any size

The test is the one the three-state essay used, generalised. A real logarithm of PP, when its eigenvalues are distinct, is a sum over the eigenvalues, log⁡P=∑ilog⁡(λi) Zi\log P = \sum_i \log(\lambda_i)\, Z_i, where each ZiZ_i is the matrix that projects onto one eigenvalue’s direction — computable from PP and the eigenvalues alone by Sylvester’s formula. A real eigenvalue has one real logarithm if it is positive and none if it is negative; a complex pair has a whole infinite family of logarithms, log⁡∣λ∣±i(θ+2πk)\log|\lambda| \pm i(\theta + 2\pi k) for every whole number kk, and the matrix that has no logarithm found that each choice of kk gives a different real logarithm of the same matrix.

So the test is: find the eigenvalues; give up if one is real and negative; for each complex pair try every branch kk that could possibly give a rate matrix; and for each combination check whether every off-diagonal entry of the logarithm is non-negative. The branches are finite in number because a rate matrix’s eigenvalues cannot have large imaginary parts — no larger than the largest rate of leaving a state, which is at most −log⁡-\log of the smallest chance of staying put — so only a handful of kk need trying. For six states with two complex pairs that is a few dozen combinations, and the census here runs it on 40,000 tables.

The tables are drawn as in the three-state essay: a random table DD, each row chosen uniformly from all probability rows, blended with staying put as (1−s)I+sD(1 - s)I + sD. At s=0s = 0 nothing moves; at s=1s = 1 the table is entirely random. The parameter ss measures how much moving happens in a year.

Half, a twenty-fourth, a two-thousandth, and none

Tables drawn entirely at random, s=1s = 1, are where the collapse is starkest, and the cheap conditions the three-state essay used show how the thinning happens.

A random table, test by test. n=2 (40000): det>0 0.5032, Goodman 0.50318, embeddable 20127 (5.03e-1); n=3 (60000): det>0 0.5025, Goodman 0.20570, embeddable 2512 (4.19e-2); n=4 (200000): det>0 0.5006, Goodman 0.09645, embeddable 115 (5.75e-4); n=5 (400000): det>0 0.5002, Goodman 0.04858, embeddable 0 (0.00e+0)
Fig. 2 Random tables through three tests: a positive determinant (exactly half at every size), Goodman’s condition that the determinant be at most the product of the chances of staying put, and the exact test. For four states 115 tables in 200,000 pass; for five, none in 400,000.

The first condition is that the determinant be positive, since det⁡eQ=etr⁡Q>0\det e^{Q} = e^{\operatorname{tr} Q} > 0. Exactly half of all random tables pass, at every size, and the reason is a symmetry rather than a calculation: swapping two rows of a table gives another table, equally likely, with the opposite determinant. The second is David Goodman’s condition, that the determinant be no larger than the product of the diagonal entries — the chances of staying put. It keeps 50% of two-state tables, where it adds nothing, 21% of three-state tables, 9.6% of four and 4.9% of five, halving with each state.

The exact test thins them much faster. Two-state tables pass exactly when their determinant is positive, a half. Three-state tables pass 4.2% of the time, the three-state essay’s one in twenty-three. Four-state tables pass 115 times in 200,000, about one in 1,700. Five-state tables passed in none of 400,000 draws here, and one in an earlier run of the same size — a share of a few in a million. Six-state tables did not pass at all.

A table of nn states has n(n−1)n(n-1) free numbers, since each row must sum to one. A rate matrix has the same number — and, as the curve that is its own slope found for a single rate, a constant rate is fixed completely by what it does in one unit of time, so counting free numbers does not rule anything out. So the embeddable tables are not a lower-dimensional sliver; they have positive volume at every size, and a small enough neighbourhood of staying put lies entirely inside them. What collapses is their share of the whole space, and the hero figure shows that the collapse begins close to staying put.

A direct move rarer than the route round

The hero figure’s most surprising curves are at small ss. With three states, 95% of tables a twentieth of the way from staying put have steady rates behind them; with six, 58%. A table that is 95%95\% staying put is hardly moving at all, and still it often cannot have come from rates. Every one of those failures is a negative rate somewhere in the logarithm, and the expansion of the logarithm near the identity says where.

A direct move rarer than the route round. D = [[0.2,0.79,0.01],[0.1,0.2,0.7],[0.3,0.3,0.4]]: rate 1->3 turns negative at s = 0.04 (second order 0.0371).
Fig. 3 A three-state table in which 1 moves to 2 with chance 0.79 and 2 to 3 with chance 0.7, but 1 to 3 directly with chance 0.01, blended with staying put. The rate from 1 to 3 in its logarithm turns negative at s=0.040s = 0.040, and at 0.0370.037 to second order.

Write the table as P=I+sEP = I + sE with E=D−IE = D - I. For small ss its logarithm is a series in the same way the ordinary logarithm is,

log⁡P=sE−s22E2+s33E3−⋯\log P = sE - \frac{s^2}{2}E^2 + \frac{s^3}{3}E^3 - \cdots

— the matrix version of log⁡(1+x)\log(1 + x), which the exponential of a square justified for the exponential and which works for the logarithm near the identity in the same way. The off-diagonal entry from 1 to 3 is sD13s D_{13} to first order, which is non-negative. The second-order term subtracts s22(E2)13\frac{s^2}{2}(E^2)_{13}, and (E2)13(E^2)_{13} contains ∑kD1kDk3\sum_k D_{1k} D_{k3} over the states kk other than 1 and 3: the chance of going from 1 to 3 in two steps by way of somewhere else.

In the example, D12D23=0.79×0.7=0.553D_{12} D_{23} = 0.79 \times 0.7 = 0.553, so the second-order term is large, while the first-order term is s×0.01s \times 0.01. They balance at

s=2D13(E2)13≈0.037,s = \frac{2 D_{13}}{(E^2)_{13}} \approx 0.037,

and the exact rate, computed from the full logarithm, turns negative at 0.0400.040. From there on, every logarithm of the table has a negative rate from 1 to 3, and the table has no steady rates behind it.

The meaning is direct. Over a year, steady rates do not only move people one step. Anyone moved from 1 to 2 early in the year is exposed to the rate from 2 to 3 for the rest of it, so steady rates that move many people from 1 to 2 and from 2 to 3 necessarily move some from 1 to 3 within the year — about s22D12D23\frac{s^2}{2}D_{12}D_{23} of them, to second order. A table whose direct entry from 1 to 3 is smaller than that has fewer people making the trip than the route round alone would deliver. To produce it, rates would have to carry some people back out of 3 into 1 at exactly the rate that cancels the route — a negative rate. This is the mechanism the three-state essay found in published credit-rating tables, where moves between distant grades were rarer than chains of moves between neighbouring grades implied; here it is the whole story near staying put.

Two states have no route round

The two-state curve in the hero figure is flat at 100% until s=0.5s = 0.5, and the expansion says why. With two states there is no third state to go round through: (E2)12(E^2)_{12} is E11E12+E12E22E_{11}E_{12} + E_{12}E_{22}, a multiple of E12E_{12} itself, so the second-order term only rescales the first and can never overturn its sign. The same holds at every order, and the exact criterion is the one the three-state essay drew as a triangle — a two-state table with chances pp and qq of switching has steady rates behind it exactly when p+q<1p + q < 1, when its determinant is positive. A blend with staying put has p+q=s(pD+qD)p + q = s(p_D + q_D), which is below one for every DD as long as s<1/2s < 1/2.

So the two-state case, the one everybody computes first, is misleading in exactly the way that matters. It suggests that a table close to staying put is always safe and that trouble only begins far from it, at a table that tends to swap. With three or more states trouble begins at once, because the route round exists from the first step, and the only question is how small ss must be before every route round is smaller than the direct move it competes with. For any particular table there is such an ss — the identity is surrounded by embeddable tables — but for a random table it can be very small, and the hero figure shows that at six states a fifth of tables are already lost by s=0.02s = 0.02.

The same counting explains why a walk that samples a distribution is usually described by a table of single steps rather than by rates: a chain built step by step has no route round within a step, and any table at all is a legitimate one-step rule. Rates are a stronger assumption than steps, and the embedding problem is the price of making it.

Every pair is a chance to fall short

Near staying put, then, a table fails when, for some ordered pair of states, the direct entry is too small compared with the two-step routes through the other states. A random row has some small entries — the chance that a uniformly random probability row has an entry below a small threshold grows with the number of entries — and each small entry is a candidate.

Near staying put, every pair is a chance to fail. n=3: 0.975/0.945/0.881; n=4: 0.941/0.865/0.735; n=5: 0.896/0.755/0.526; n=6: 0.807/0.575/0.388
Fig. 4 Near staying put, minus the logarithm of the share passing, against the number of ordered pairs of states. At s=0.05s = 0.05, 95%, 87%, 76% and 58% pass for three to six states, and the count of failures grows with the pairs, slightly faster than in proportion.

If each ordered pair failed independently with the same small chance, the share passing would be e−c n(n−1)e^{-c\, n(n-1)} for a constant cc, and minus its logarithm would be a straight line against the number of pairs. The measurement is close to that and bends slightly upwards: the chance for each pair grows with nn too, because with more states there are more routes round to compete with each direct move — the sum ∑kDikDkj\sum_k D_{ik}D_{kj} has n−2n - 2 terms — while the direct entry, a random share of a row of nn, gets smaller. At s=0.05s = 0.05 the share passing falls from 95% at three states to 58% at six.

The scaling has a practical reading. A table estimated from data, for a system with many states and short periods between observations, is close to staying put — and it is exactly that kind of table which the expansion says will fail, since sampling noise makes many small entries smaller than the routes round predict. The more states, the more pairs, and the more certain it becomes that some pair falls short, even when the process really did run at steady rates and only the estimate is off.

Two ways to fail

Far from staying put the failures change character.

Two ways to fail. n=3 s=0.1: ok 1322, negrate 178, negreal 0 of 1500; n=4 s=0.1: ok 1103, negrate 397, negreal 0 of 1500; n=5 s=0.1: ok 421, negrate 379, negreal 0 of 800; n=6 s=0.1: ok 310, negrate 490, negreal 0 of 800; n=3 s=0.5: ok 680, negrate 820, negreal 0 of 1500; n=4 s=0.5: ok 162, negrate 1338, negreal 0 of 1500; n=5 s=0.5: ok 16, negrate 784, negreal 0 of 800; n=6 s=0.5: ok 0, negrate 800, negreal 0 of 800; n=3 s=1: ok 64, negrate 528, negreal 908 of 1500; n=4 s=1: ok 2, negrate 521, negreal 977 of 1500; n=5 s=1: ok 0, negrate 228, negreal 572 of 800; n=6 s=1: ok 0, negrate 180, negreal 620 of 800
Fig. 5 How the census’s tables fail, for three to six states at three distances from staying put: a negative rate, or a negative real eigenvalue. Near staying put every failure is a negative rate; drawn at random, most are negative eigenvalues.

Close to staying put all the eigenvalues are close to one, and no failure in the census is a negative eigenvalue: they are all negative rates, the route round. Half-way, at s=0.5s = 0.5, the same is true, though now almost every table fails. For tables drawn at random most failures are a negative real eigenvalue, a table that tends to swap states back and forth from one year to the next, which a steady flow cannot do — two numbers decide the flow found steady linear flows spiralling or decaying, never flipping sign at fixed intervals. The eigenvalues of eQe^{Q} are eμe^{\mu} for the eigenvalues μ\mu of QQ, and eμe^{\mu} is never a negative real number unless μ\mu is complex and comes in a pair, which a single real eigenvalue cannot. With four states two-thirds of random tables have such an eigenvalue, and among the rest the route round finishes the job.

What the census does not settle

Every test here assumes distinct eigenvalues. A random table has them with probability one, so the census loses nothing, but particular tables of interest — tables with symmetries, or with states that cannot be told apart — have repeated eigenvalues, and then a matrix can have a continuum of logarithms, as the matrix that has no logarithm found for minus the identity. Deciding whether any member of a continuum is a rate matrix is a different problem, and the method here does not touch it.

One family of tables escapes the branch search altogether. A table that is reversible — one where, in the long run, as many people move from each state to each other state as move back, the property the chain that runs the same backwards studied — is similar to a symmetric matrix, so its eigenvalues are all real. Then there are no complex pairs and no branches: the table has steady rates behind it exactly when every eigenvalue is positive and its one real logarithm has no negative rate. The route round still applies, and it is the only way such a table near staying put can fail.

The uniform distribution over tables is also a choice. Real tables are not random; they usually have most of their weight on the diagonal and structure off it, as mobility and credit tables do. The census describes the space of possibilities, not the tables anyone collects, and its value is in the mechanism it isolates rather than in its particular percentages. The finite census of shares — 1,500 or 800 tables a point — puts a few percentage points of noise on each, visible as small wobbles in the hero figure’s curves.

Still open: the nearest table with rates behind it

Given a table with no steady rates behind it, what is the nearest one that has them, and can it be found efficiently? The repairs used in practice for credit tables are heuristics: compute the principal logarithm, set the negative rates to zero, and adjust the diagonal so that rows still sum to zero, or redistribute the negative mass among the positive rates of the same row. Each gives a table with rates behind it, but not the nearest one in any stated sense, and the set of embeddable tables is not convex, so the nearest point may not be unique. For three states the problem can be settled by search; for many states no efficient method with a guarantee is known.

There is also a sharper version of the census question. The share of embeddable tables among random ones is about 10−0.310^{-0.3}, 10−1.410^{-1.4}, 10−3.210^{-3.2} and around 10−5.510^{-5.5} for two to five states; whether it falls like e−cn2e^{-cn^2}, as the count of pairs near staying put would suggest, or faster, is not known, and the figures here are too few to tell. The three-state essay recorded the case of four states with distinct eigenvalues as settled only recently by an explicit search through branches of the kind used here; a formula for the share at any size is not in sight.

Rates always make the route round

Steady rates that move people from 1 to 2 and from 2 to 3 must also move some from 1 to 3 within a year, and a table that shows fewer direct moves than that route round cannot have come from steady rates. That one fact, the second-order term of a matrix logarithm, explains why tables close to staying put fail more and more often as states are added: every ordered pair of states is a separate chance for the direct move to fall short, and at a twentieth of the way from staying put the share with rates behind them falls from 95% for three states to 58% for six. Drawn entirely at random, half of two-state tables, one in twenty-four three-state tables, about one in 1,700 four-state tables and almost no larger tables have steady rates behind them — exactly half pass the first condition at every size, and the rest is the route round and the negative eigenvalue.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

DeterminantEigenvalueLogarithmMarkov chainMatrix exponentialTransition matrix