Efficient inversion of Cholesky decomposed matrix

43 Views Asked by At

I'm programming a machine learning model in C#, using the MathNet.Numerics library. As a part of this I am writing a class that models a distribution parameterized by a positive definite matrix $M$. To avoid having to invert $M$ the class uses the Cholesky decomposition $M = L L^T$ internally; I compute this decomposition already in the class constructor, and then keep it in memory to avoid having to recompute it.

Now, in certain situations it would be useful for other classes to be able to obtain $M^{-1}$ explicitly. Instead of inverting $M$ directly, I might then instead invert $L$ (which I already have available) and thus obtain $M^{-1}$ via

$$M^{-1} = (L^{-1})^T L^{-1}.$$

But this is only more efficient if $L$ is faster to invert in than $M$. I think it should be, in theory, since $L$ is lower triangular.

The MathNet.Numerics library seems to use LU decomposition internally to implement matrix inversion. With this in mind, will the above inversion strategy be more efficient than direct inversion of $M$? Or will a standard inversion algorithm using LU decomposition not be able to take advantage of the fact that the input matrix is lower triangular?