Sherman–Morrison formula explained

A

and the outer product

uvsf{T}

of vectors

u

and

v,

the formula cheaply computes an updated matrix inverse \left(A + uv^\textsf\right)\vphantom)^.

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

Statement

Suppose

A\inRn x

is an invertible square matrix and

u,v\inRn

are column vectors. Then

A+uvsf{T}

is invertible iff

1+vsf{T}A-1u0

. In this case,

\left(A+uvsf{T}\right)-1=A-1-{A-1uvsf{T}A-1\over1+vsf{T}A-1u}.

Here,

uvsf{T}

is the outer product of two vectors

u

and

v

. The general form shown here is the one published by Bartlett.[4]

Proof

(

\Leftarrow

) To prove that the backward direction

1+vsf{T}A-1u0A+uvsf{T}

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+uvsf{T}

) if and only if

XY=YX=I

.

We first verify that the right hand side (

Y

) satisfies

XY=I

.

\begin{align} XY&=\left(A+uvsf{T}\right)\left(A-1-{A-1uvsf{T}A-1\over1+vsf{T}A-1u}\right)\\[6pt] &=AA-1+uvsf{T}A-1-{AA-1uvsf{T}A-1+uvsf{T}A-1uvsf{T}A-1\over1+vsf{T}A-1u}\\[6pt] &=I+uvsf{T}A-1-{uvsf{T}A-1+uvsf{T}A-1uvsf{T}A-1\over1+vsf{T}A-1u}\\[6pt] &=I+uvsf{T}A-1-{u\left(1+vsf{T}A-1u\right)vsf{T}A-1\over1+vsf{T}A-1u}\\[6pt] &=I+uvsf{T}A-1-uvsf{T}A-1\\[6pt] &=I \end{align}

To end the proof of this direction, we need to show that

YX=I

in a similar way as above:

YX=\left(A-1-{A-1uvsf{T}A-1\over1+vsf{T}A-1u}\right)(A+uvsf{T})=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+vsf{T}A-1u=0

, then via the matrix determinant lemma,

\det\left(A+uvsf{T}\right)=(1+vsf{T}A-1u)\det(A)=0

, so

\left(A+uvsf{T}\right)

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

uvsf{T}

(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+uvsf{T}

does not have to be computed from scratch (which in general is expensive), but can be computed by correcting (or perturbing)

A-1

.

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.[5] In the general case, where

A-1

is an

n

-by-

n

matrix and

u

and

v

are arbitrary vectors of dimension

n

, the whole matrix is updated and the computation takes

3n2

scalar multiplications.[6] 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.[7] The inverse propagator (as it appears in the Lagrangian) has the form

A+uvsf{T}

. 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[8] 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 [9] 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

\left(I+wvsf{T}\right)-1=I-

wvsf{T
}.

Let

u=Aw,andA+uvsf{T}=A\left(I+wvsf{T}\right),

then

\left(A+uvsf{T}\right)-1=\left(I+wvsf{T}\right)-1A-1=\left(I-

wvsf{T
}\right)A^.

Substituting

w=A-1u

gives

\left(A+uvsf{T}\right)-1=\left(I-

A-1uvsf{T
} \right)A^ = A^ - \frac

Generalization (Woodbury matrix identity)

Given a square invertible

n x n

matrix

A

, an

n x k

matrix

U

, and a

k x n

matrix

V

, let

B

be an

n x n

matrix such that

B=A+UV

. Then, assuming

\left(Ik+VA-1U\right)

is invertible, we have

B-1=A-1-A-1U\left(Ik+VA-1U\right)-1VA-1.

See also

Notes and References

  1. Jack . Sherman . Winifred J. . Morrison . 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 . 1949 . 10.1214/aoms/1177729959. free.
  2. Jack . Sherman . Winifred J. . Morrison . Adjustment of an Inverse Matrix Corresponding to a Change in One Element of a Given Matrix . . 21 . 1 . 124 - 127 . 1950 . 10.1214/aoms/1177729893 . 35118 . 0037.00901. free .
  3. William W. . Hager . Updating the inverse of a matrix . SIAM Review . 31 . 1989 . 221 - 239 . 2 . 10.1137/1031049 . 997457 . 2030425 . 7967459 .
  4. Maurice S. . Bartlett . An Inverse Matrix Adjustment Arising in Discriminant Analysis . . 22 . 1 . 107 - 111 . 1951 . 10.1214/aoms/1177729698 . 40068 . 0042.38203. free .
  5. [Amy Langville|Langville, Amy N.]
  6. http://www.alglib.net/matrixops/general/invupdate.php Update of the inverse matrix by the Sherman–Morrison formula
  7. [Propagator#Spin 1]
  8. Web site: Perturbative quantum field theory.
  9. Web site: MathOverflow discussion. MathOverflow.