Sherman–Morrison formula explained
and the
outer product
of
vectors
and
the formula cheaply computes an updated matrix inverse
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
is an
invertible square matrix and
are
column vectors. Then
is invertible
iff
. In this case,
\left(A+uvsf{T}\right)-1=A-1-{A-1uvsf{T}A-1\over1+vsf{T}A-1u}.
Here,
is the
outer product of two vectors
and
. The general form shown here is the one published by Bartlett.
[4] Proof
(
) To prove that the backward direction
1+vsf{T}A-1u ≠ 0 ⇒ A+uvsf{T}
is invertible with inverse given as above) is true, we verify the properties of the inverse. A matrix
(in this case the right-hand side of the Sherman–Morrison formula) is the inverse of a matrix
(in this case
) if and only if
.
We first verify that the right hand side (
) satisfies
.
\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
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
and
,
is equivalent to
.)
(
) Reciprocally, if
, then via the
matrix determinant lemma,
\det\left(A+uvsf{T}\right)=(1+vsf{T}A-1u)\det(A)=0
, so
is not invertible.
Application
If the inverse of
is already known, the formula provides a
numerically cheap way to compute the inverse of
corrected by the matrix
(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
does not have to be computed from scratch (which in general is expensive), but can be computed by correcting (or perturbing)
.
Using unit columns (columns from the identity matrix) for
or
, individual columns or rows of
may be manipulated and a correspondingly updated inverse computed relatively cheaply in this way.
[5] In the general case, where
is an
-by-
matrix and
and
are arbitrary vectors of dimension
, the whole matrix is updated and the computation takes
scalar multiplications.
[6] If
is a unit column, the computation takes only
scalar multiplications. The same goes if
is a unit column. If both
and
are unit columns, the computation takes only
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
. 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-
}.
Let
u=Aw, and A+uvsf{T}=A\left(I+wvsf{T}\right),
then
\left(A+uvsf{T}\right)-1=\left(I+wvsf{T}\right)-1A-1=\left(I-
}\right)A^.
Substituting
gives
\left(A+uvsf{T}\right)-1=\left(I-
} \right)A^ = A^ - \frac
Given a square invertible
matrix
, an
matrix
, and a
matrix
, let
be an
matrix such that
. Then, assuming
is invertible, we have
B-1=A-1-A-1U\left(Ik+VA-1U\right)-1VA-1.
See also
Notes and References
- 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.
- 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 .
- William W. . Hager . Updating the inverse of a matrix . SIAM Review . 31 . 1989 . 221 - 239 . 2 . 10.1137/1031049 . 997457 . 2030425 . 7967459 .
- Maurice S. . Bartlett . An Inverse Matrix Adjustment Arising in Discriminant Analysis . . 22 . 1 . 107 - 111 . 1951 . 10.1214/aoms/1177729698 . 40068 . 0042.38203. free .
- [Amy Langville|Langville, Amy N.]
- http://www.alglib.net/matrixops/general/invupdate.php Update of the inverse matrix by the Sherman–Morrison formula
- [Propagator#Spin 1]
- Web site: Perturbative quantum field theory.
- Web site: MathOverflow discussion. MathOverflow.