-1

Suppose I have $M = A N A^t,$ where $A$ is not necessarily square, and $M, N$ are symmetric. If I know the inverse of $N,$ is there any particularly easy way to compute the inverse of $M?$ (and yes, I know that $M$ might not be invertible - "compute the inverse" means also "tell me if there is not one").

For background: I am using Newton's method to minimize a function $f$ which can be written as $f = g \circ h,$ with $h$ linear. I can compute and invert the Hessian of $g$ by hand. $A$ is the Jacobian of $h.$

Igor Rivin
  • 26,372
  • The given hypothesis are even not sufficient to ensure that the inverse of $M$ exists... – TheSilverDoe Jun 01 '22 at 16:33
  • 4
    @TheSilverDoe That is part of the question. It is amazing how many people are itching to down-vote a perfectly reasonable question. This forum has certainly gone way downhill. – Igor Rivin Jun 01 '22 at 16:46
  • Have you tried using the pseudo-inverse? – Cameron L. Williams Jun 01 '22 at 17:00
  • @CameronWilliams I am not sure how that would help. See the edit to see where the question came from. – Igor Rivin Jun 01 '22 at 17:05
  • There's a nice trick using $N^{1/2}$ and SVD in the case that $N$ is positive definite, which is guaranteed in the case that $g$ is strictly convex. I'm not sure if that's of any help in your situation. – Ben Grossmann Jun 01 '22 at 17:19
  • @BenGrossmann $N$ is positive definite in my case, so I am curious to see the trick! In my case, actually $N$ is a rank one perturbation of a diagonal matrix, so the Sherman-Morrison formula (which is mentioned in the thing your answer links to) works, but your mystery trick might work better yet! – Igor Rivin Jun 01 '22 at 17:24
  • 1
    @IgorRivin I don't think the trick is quite as spectacular as I initially thought, but I'll add it anyway – Ben Grossmann Jun 01 '22 at 17:26

1 Answers1

2

Here's one way to approach the problem.

I assume that $A$ is of size $m \times n$ with $m < n$. If $A$ has rank less than $m$, then $M$ cannot be invertible. Otherwise, there exists a matrix $B$ such that the matrix $\binom AB$ is invertible. We note that $$ \pmatrix{A\\B}N\pmatrix{A\\B}^T = \pmatrix{ANA^T & ANB^T\\B^TNA & B^TNB}. $$ We have $$ \left[\pmatrix{A\\B}N\pmatrix{A\\B}^T\right]^{-1} = \pmatrix{A\\B}^{-T}N^{-1}\pmatrix{A\\B}^{-1}, $$ which means that it suffices to use the inverse of this large matrix to find the inverse of its submatrix. As is discussed here, this can be done with the help of the Woodbury formula.


In the case that $N$ is positive definite, we can write $$ M = AN^{1/2}[N^{1/2}]^TA^T = (AN^{1/2})(AN^{1/2})^T. $$ From there, if $AN^{1/2} = U \Sigma V^T$ is an SVD, then we can write $$ M^{-1} = [U \Sigma \Sigma^T U^T]^{-1} = U [\Sigma \Sigma^T]^{-1} U^T. $$ Of course, $[\Sigma \Sigma^T]^{-1}$ is the inverse of a square diagonal matrix.

In fact, it is not important to have $N^{1/2}$ be the positive definite square root of $N$ here, it suffices to replace $N^{1/2}$ with $L$ from the Cholesky decomposition $LL^T = N$. Because $N$ is a rank-one update of a diagonal matrix, its Cholesky decomposition is relatively inexpensive to compute

Igor Rivin
  • 26,372
Ben Grossmann
  • 234,171
  • 12
  • 184
  • 355