Sherman–Morrison formula

From HandWiki
Short description: Formula computing the inverse of the sum of a matrix and the outer product of two vectors

In linear algebra, the Sherman–Morrison formula, named after Jack Sherman and Winifred J. Morrison, computes the inverse of a "rank-1 update" to a matrix whose inverse has previously been computed.[1][2][3] That is, given an invertible matrix A and the outer product uvT of vectors u and v, the formula cheaply computes an updated matrix inverse (A+uvT))1.

The Sherman–Morrison formula is a special case of the Woodbury formula. Though named after Sherman and Morrison, it appeared already in earlier publications.[4]

Statement

Suppose An×n is an invertible square matrix and u,vn are column vectors. Then A+uvT is invertible iff 1+vTA1u0. In this case,

(A+uvT)1=A1A1uvTA11+vTA1u.

Here, uvT is the outer product of two vectors u and v. The general form shown here is the one published by Bartlett.[5]

Proof

() To prove that the backward direction 1+vTA1u0A+uvT is invertible with inverse given as above) is true, we verify the properties of the inverse. A matrix Y (in this case the right-hand side of the Sherman–Morrison formula) is the inverse of a matrix X (in this case A+uvT) if and only if XY=YX=I.

We first verify that the right hand side (Y) satisfies XY=I.

XY=(A+uvT)(A1A1uvTA11+vTA1u)=AA1+uvTA1AA1uvTA1+uvTA1uvTA11+vTA1u=I+uvTA1uvTA1+uvTA1uvTA11+vTA1u=I+uvTA1u(1+vTA1u)vTA11+vTA1u=I+uvTA1uvTA1

To end the proof of this direction, we need to show that YX=I in a similar way as above:

YX=(A1A1uvTA11+vTA1u)(A+uvT)=I.

(In fact, the last step can be avoided since for square matrices X and Y, XY=I is equivalent to YX=I.)

() Reciprocally, if 1+vTA1u=0, then via the matrix determinant lemma, det(A+uvT)=(1+vTA1u)det(A)=0, so (A+uvT) is not invertible.

Application

If the inverse of A is already known, the formula provides a numerically cheap way to compute the inverse of A corrected by the matrix uvT (depending on the point of view, the correction may be seen as a perturbation or as a rank-1 update). The computation is relatively cheap because the inverse of A+uvT does not have to be computed from scratch (which in general is expensive), but can be computed by correcting (or perturbing) A1.

Using unit columns (columns from the identity matrix) for u or v, individual columns or rows of A may be manipulated and a correspondingly updated inverse computed relatively cheaply in this way.[6] In the general case, where A1 is a n-by-n matrix and u and v are arbitrary vectors of dimension n, the whole matrix is updated[5] and the computation takes 3n2 scalar multiplications.[7] If u is a unit column, the computation takes only 2n2 scalar multiplications. The same goes if v is a unit column. If both u and v are unit columns, the computation takes only n2 scalar multiplications.

This formula also has application in theoretical physics. Namely, in quantum field theory, one uses this formula to calculate the propagator of a spin-1 field.[8][circular reference] The inverse propagator (as it appears in the Lagrangian) has the form A+uvT. One uses the Sherman–Morrison formula to calculate the inverse (satisfying certain time-ordering boundary conditions) of the inverse propagator—or simply the (Feynman) propagator—which is needed to perform any perturbative calculation[9] involving the spin-1 field.

One of the issues with the formula is that little is known about its numerical stability. There are no published results concerning its error bounds. Anecdotal evidence [10] suggests that the Woodbury matrix identity (a general case of the Sherman–Morrison formula) may diverge even for seemingly benign examples (when both the original and modified matrices are well-conditioned).

Alternative verification

Following is an alternate verification of the Sherman–Morrison formula using the easily verifiable identity

(I+wvT)1=IwvT1+vTw.

Let

u=Aw,andA+uvT=A(I+wvT),

then

(A+uvT)1=(I+wvT)1A1=(IwvT1+vTw)A1.

Substituting w=A1u gives

(A+uvT)1=(IA1uvT1+vTA1u)A1=A1A1uvTA11+vTA1u

Generalization (Woodbury matrix identity)

Given a square invertible n×n matrix A, an n×k matrix U, and a k×n matrix V, let B be an n×n matrix such that B=A+UV. Then, assuming (Ik+VA1U) is invertible, we have

B1=A1A1U(Ik+VA1U)1VA1.

See also

References

  1. Sherman, Jack; Morrison, Winifred J. (1949). "Adjustment of an Inverse Matrix Corresponding to Changes in the Elements of a Given Column or a Given Row of the Original Matrix (abstract)". Annals of Mathematical Statistics 20: 621. doi:10.1214/aoms/1177729959. 
  2. Sherman, Jack; Morrison, Winifred J. (1950). "Adjustment of an Inverse Matrix Corresponding to a Change in One Element of a Given Matrix". Annals of Mathematical Statistics 21 (1): 124–127. doi:10.1214/aoms/1177729893. 
  3. Press, William H.; Teukolsky, Saul A.; Vetterling, William T.; Flannery, Brian P. (2007), "Section 2.7.1 Sherman–Morrison Formula", Numerical Recipes: The Art of Scientific Computing (3rd ed.), New York: Cambridge University Press, ISBN 978-0-521-88068-8, http://apps.nrbook.com/empanel/index.html?pg=76, retrieved 2011-08-08 
  4. Hager, William W. (1989). "Updating the inverse of a matrix". SIAM Review 31 (2): 221–239. doi:10.1137/1031049. 
  5. 5.0 5.1 Bartlett, Maurice S. (1951). "An Inverse Matrix Adjustment Arising in Discriminant Analysis". Annals of Mathematical Statistics 22 (1): 107–111. doi:10.1214/aoms/1177729698. 
  6. Langville, Amy N.; and Meyer, Carl D.; "Google's PageRank and Beyond: The Science of Search Engine Rankings", Princeton University Press, 2006, p. 156
  7. Update of the inverse matrix by the Sherman–Morrison formula
  8. Propagator
  9. "Perturbative quantum field theory". https://ncatlab.org/nlab/show/perturbative+quantum+field+theory. 
  10. "MathOverflow discussion". https://mathoverflow.net/questions/80340/special-considerations-when-using-the-woodbury-matrix-identity-numerically.